Previous | Contents | Index |
The xmpiano program shows how to write a Motif Interface to Dumb Instruments (MIDI) application. Both a staff, for writing music, and keyboard are provided.
At the bottom of the window is a set of notes that may be used on the staff. Selecting one of these note buttons changes the active note accordingly. The selected note is also displayed as the new mouse cursor.
Though the note selection is limited, it is possible to play sharps as well as naturals. The program interface has not been written to play flats. The staff automatically resizes larger as notes are added past the right side of the staff. To see these notes, scroll the score window as needed.
To use this application, press the right mouse button on a staff that is visible. The following menu items are displayed:
This version does not allow editing of notes. To edit, clear the staff and start again, or read the data from a saved file.
To set the color of the notes, change the foreground color of the application. To do this, use the -fg option on the command line. For example:
$ xmpiano :== $DECW$EXAMPLES:xmpiano $ xmpiano -fg blue |
B.4.13 Motif Sample Programs
V1.2
Table B-6 lists sample programs showing various Motif Toolkit functionality.
File Name | Description |
---|---|
xmdialogs.c | dialog sampler |
xmfonts.c | font browser |
xmeditor.c | text editor |
xmlist.c | list example |
xmprotocol.c | window manager protocols example |
xmter.c | shape & animation example |
xmform.c | form attachment example |
xmforc.c | form attachment + rowcolumn example |
xmmap.c | drawingarea + scrolledwindow example |
xmgetres.c | resource fetching example |
xmapdef.c | app defined scrolled window example |
The following notes apply to these sample programs:
$ xmform :== $DECW$EXAMPLES:xmform $ xmform string |
$ xmgetres :== $DECW$EXAMPLES:xmgetres $ xmgetres WidgetClass |
The xmtravel example is a front end to a travel agent client and flight database. The program is designed to illustrate various user-interface design concepts as well as be compliant with the OSF/Motif Style Guide.
The program is just an example, many of the functions are either not
implemented or use predefined settings.
B.4.15 Resource Files for Example Programs
Many of the example programs have associated resource files for defining various display attributes. To use these files, either copy them from the directory DECW$EXAMPLES to your DECW$USER_DEFAULTS directory, or add their contents to your DECW$XDEFAULTS.DAT file.
The list of example programs and the resource files associated with them is as follows:
Example Program | Resource File |
---|---|
DECW$CDPLAYER.EXE | DECW$CDPLAYER.DAT |
FILEVIEW.EXE | FILEVIEW.DAT |
PERIODIC.EXE | PERIODIC.DAT |
MOTIFANM.EXE | MOTIFANIM.DAT |
XMAPDEF.EXE | XMDEMOS.DAT |
XMDIALOGS.EXE | XMDEMOS.DAT |
XMEDITOR.EXE | XMDEMOS.DAT |
XMFONTS.EXE | XMDEMOS.DAT |
XMFORC.EXE | XMDEMOS.DAT |
XMFORM.EXE | XMDEMOS.DAT |
XMGETRES.EXE | XMDEMOS.DAT |
XMLIST.EXE | XMDEMOS.DAT |
XMMAP.EXE | XMDEMOS.DAT |
XMPROTOCOL.EXE | XMDEMOS.DAT |
XMTER.EXE | XMDEMOS.DAT |
XMTRAVEL.EXE | XMTRAVEL.DAT |
If a resource file is not found, the example programs run, but some of
the display attributes may be incorrect.
B.4.16 UID Files for Example Programs
The UID files used by the example programs must be located in either
the current directory or your DECW$USER_DEFAULTS directory. If they are
not found, the application fails to start. The UID files can be copied
from the DECW$EXAMPLES directory.
B.5 OSF/Motif List of Known Problems
Included in the DECwindows Motif software is an OSF file that contains the OSF/Motif known problems. During the installation this file is copied from the kit to SYS$HELP:DECW$MOTIF_OSF_BUGLIST_V12.TXT.
Index | Contents |