Motif is an extension of the X-windows window manager interface. It provides a visually pleasing interface and allows the programmer to easily generate user friendly features such as push buttons, scrolled text windows, and pop-up dialogs. This section presents a brief overview of using motif. These motif structures are used in all of the UNCERT modules and once you are comfortable with one module, the other modules will "feel" much the same.
The application area is simply where the program is displayed.
The control button, when activated, displays a menu of window control options. However, most of the options can be more easily controlled by methods discussed below. The one exception is the item "close." Sometimes a window can "lock-up" and the application in the window no longer responds to the user; by selecting the "close" menu option, X-windows destroys the window and terminates the application process. This is not the recommended way to quit an application, but is a reasonable approach when the application is no longer responding.
It is also possible to use the menu largely without using the mouse, but instead using keyboard commands. By examining Figure 3.2, most menu items have one character underlined. The underlined character identifies the key stroke that will activate each selection. Items on the main menu bar are selected by holding the <ALT> key with the appropriate character, items from sub-menus are selected by typing the character only. For example, to select the GRIDZO file type, as shown in (Figure 3.2), the correct key stroke sequence is:
Some sub-menu items also have "..." proceeding them. These indicate that a pop-up dialog window will be displayed after its selection.
A simple dialog box may be composed simply of a message, and an OK button. Generally the message will inform the user that some other task must be performed before the desired selection can be performed, or that the application does not currently support that feature currently. After the user has read the message, pressing the OK button or hitting return will remove the message dialog.
Scrolled text areas are used to display textual information (such as a file) or display a list of options the user can select from (such as a list of all the files in the current directory). Often there is more information available then can be presented in the area supplied; when this occurs scroll-bars are attached to the bottom and side of the text area (Figure 3.5).
In the middle of the scroll-bar is a black button; at the ends are two
arrows. If the black button extends from arrow to arrow, all the text is visible with regard to that scroll-bar (the horizontal scroll-bar controls visible columns, the vertical scroll-bar controls visible rows or lines). To move the view area one line or column at a time, one presses the appropriate scroll-bar arrow with the mouse pointer. To page down one presses the grayed area immediately below the scroll-bar button. To page up one presses the grayed area immediately above the scroll-bar button. A similar logic applies to the horizontal scroll-bar. Text can also be scrolled by pressing the appropriate scroll- bar button, holding the mouse button, and dragging the button up and down (or left and right) as desired.
If the text field is a selection area, as with a file selection dialog (to be discussed below), to select the desired item, point at the appropriate line with the mouse pointer, and press the left mouse button. The selected item will become highlighted. Note: many programs will let one double-click with the mouse on the selected item to execute the dialogs function (e.g., in a file selection dialog double-clicking on a filename will highlight the selection and pass the filename back to the program for further processing).
A slider-bar is used to allow the user to select a value from a closed range of continuous values. For example, a user might want to select a view direction over a surface; because view directions vary from 0-360 degrees only, a slider-bar can be reasonably used to select a desired variable value. A typical scroll-bar is shown in Figure 3.6. A slider-bar has a title, a position indicator, and a slider button. To move the slider-bar, the slider-bar button is pressed and held with the left mouse button, and dragged to the desired position. It is also possible to press on the grayed area to either side of the slider-bar button. This will move the slider-bar button 1/10 of the total range of the slider-bar in the indicated direction (i.e. +/-36 degrees for the above example).
Note that with slider-bars, the desired value is not always exactly attainable. Slider-bars are limited to 100 positions. This means that with the view directions mentioned above, the smallest angular step is 3.6 degrees.
Text fields are used to enter new variable values. The format of a text field in show in Figure 3.7. It is composed of the variable name and a recessed text entry box. To enter a new value in the entry box, select the text field with the mouse button, erase the previous entry and type in the new entry. To enter the new value press <RETURN> when done, or press OK or Apply if the text field is part of a pop-up dialog box. To erase a previous entry, one can 1) position the insert cursor at the end of the current entry and backspace over the old entry, 2) quickly double-click with the left mouse button in the text field; this highlights the entire selection, and the next typed key will replace the highlighted selection, or 3) using the mouse, holding the left mouse button down, starting at one end of the selection, dragging the mouse over the rest of the selection will highlight it; the next typed key will replace the highlighted selection.
Many program options are ON or OFF, TRUE or FALSE. Toggle buttons are vary useful for defining these variables or parameters. Two toggle buttons are shown in Figure 3.8, the top one is OFF/FALSE and appears raised. and the bottom button is ON/TRUE appearing recessed. To the right of the toggle is the description. Toggle buttons are always squares. The toggle is changed by pressing the toggle button.
For many variables, they must be set to one possible option, out of several possibilities (e.g. the line color can be 1) red, 2) blue, or 3) green). These variables are defined with a toggle menu. A toggle menu can have only one active selection at a time. An example toggle menu is shown on Figure 3.9. It has a menu title followed by a series of diamond shaped toggles, the active toggle or selection appearing recessed, the rest raised. To select a menu option press the toggle next to the desired description; that option will be activated, and the previous selection will be turned off.
Very similar to the toggle menu and serving the same purpose is the Option Menu List. This button/menu allows the user to select one possible option, out of several possibilities. A option menu list can have only one active selection at a time and this is the default label button/menu Figure 3.10a. The alternate options are displayed by pressing on the button/menu. When the list is display (Figure 3.10b), an item is selected by clicking on it.