Menus provide controls for frequently used features of an application. Once you have selected a Menu, choosing an item on that Menu initiates an associated action. Remember that while a Menu is posted, you cannot interact with other components of the application. Motif supports these types of Menus:
Pulldown Menus are accessed from the labels that represent them. When you select the label of a Pulldown Menu, the Menu pane appears like you had pulled down a window shade. The most commonly used Pulldown Menus in an application are placed on the MenuBar of an application. Figure 3-5 shows a File Menu pulled down from the MenuBar.
Figure 13. File Menu Pulled Down from the MenuBar.
Pulldown Menus contain items that perform common application actions. Pulldown Menus can also contain nested submenus called cascading Menus.
Motif provides two different styles of mouse-based interaction with Pulldown Menus: spring-loaded interaction and posted interaction.
To select a Menu item using spring-loaded interaction:
During a spring-loaded interaction, you can examine the contents of each Menu on the MenuBar by pressing Button 1 and dragging the pointer along the Menu titles in the MenuBar. As you drag through each title, the corresponding Menu will be displayed. You can cancel a spring-loaded interaction by moving the pointer anywhere outside of the Menu system and releasing Button 1.
To select a Menu item using posted interaction:
During a posted interaction, you can cancel the Menu by moving the pointer to the Menu name or anywhere outside of the Menu system and pressing Button 1.
To select a Menu item using the keyboard:
You can cancel a Menu using the keyboard by pressing F10. The input focus will return to the component that had it prior to the Menu interaction. Press Cancel to back out of the Menu hierarchy. If the input focus is in the MenuBar or a Menu pulled down from it, Cancel works just like F10. Otherwise, Cancel unposts just the last cascaded submenu.
In Motif Style Guide compliant applications, you can always find the Exit command in the first Pulldown Menu on the MenuBar, which is typically the File Menu. If an application includes a Help Menu, it is always the farthest right Menu on the MenuBar. Compliant applications may also use other standard Menus that are defined by the Motif Style Guide, such as the Edit, View, and Options Menus.
In addition to the item name, a Menu selection can also provide additional visual clues to its functionality. For example, the presence of a cascading submenu is indicated by a triangle at the right side of a Menu item. A grayed out item name indicates that the selection is not valid at the current time. The ... (ellipsis points) after a Menu item means that the application requires more information to perform the action of the Menu item.
An application can provide rapid keyboard access to Menus and Menu items by specifying mnemonics. If a Menu or a Menu item has a mnemonic associated with it, the mnemonic character is underlined in the label for the Menu or Menu item. Typing Alt plus the mnemonic for a Menu posts the associated Menu. Once a Menu is posted, typing the mnemonic for a Menu item is equivalent to selecting the associated Menu item. Mnemonics for Menu items only work when the Menu containing the items is posted.
Some applications use a combination of keystrokes, called accelerators, to create shortcuts for accessing Menu items. If a Menu item has an accelerator associated with it, the required keystrokes are shown to the right of the item name. Entering an accelerator sequence activates the Menu item whether or not the Menu is posted. Figure 3-6 shows a Pulldown Menu that provides both mnemonics and accelerators.
Figure 14. Menu Mnemonics and Accelerators.
Different areas of an application can have Popup Menus associated with them. You can only access a Popup Menu when the pointer is over an area that is associated with a Popup Menu. A Popup Menu does not provide any visual clues to let you know of its existence. Therefore, Popup Menus only provide short cuts to functionality that is available elsewhere in an application. The contents of a Popup Menu can be context sensitive, which means that the items on the Menu can vary based on a number of factors, such as the location of the pointer when the Menu is posted or the selection state of a component.
To activate a Popup Menu with the mouse:
Popop Menus provide both spring-loaded and posted interaction styles. Select items on a Popup Menu just as you would on a Pulldown Menu. You can select items on a posted Popup Menu using either Button 1 or Button 3. To cancel a posted Popup Menu, click Button 1 or Button 3 outside of the Menu pane.
If the input focus is in an area where there is an inactive Popup Menu, you can post the Menu by pressing Menu or Shift F10. You can select an item on a Popup Menu with the keyboard by using the arrow keys and pressing Return. To cancel a Popup Menu from the keyboard, press Cancel.
An Option Menu presents a list of choices within a relatively small space. A bar graphic on the right side of an OptionButton signifies the presence of an Option Menu. When you select an OptionButton, the associated Option Menu is presented and you can make a selection. When the Option Menu is not posted, the OptionButton displays the current selection. Figure 3-7 shows an OptionButton with its bar graphic and the associated Option Menu.
Figure 15. An OptionButton and Associated Option Menu.
To post an Option Menu with the mouse:
Option Menus provide both spring-loaded and posted interaction styles. Select an item on an Option Menu just as you would on a Pulldown Menu. To cancel a posted Option Menu, click Button 1 on the bar graphic or anywhere outside of the Menu pane.
If an OptionButton has the input focus, you can post the Menu from the keyboard by pressing Select or Space. Select an item on the Option Menu by using the arrow keys and pressing Select or Space. To cancel an Option Menu from the keyboard, press Cancel.
TearOff Menus allow you to keep frequently used Menus on the screen. Normally, a Menu disappears after you make a selection, but a TearOff Menu remains posted until you cancel it. TearOff Menus are so called because they imitate in appearance a coupon that is torn off.
Pulldown Menus, Popup Menus, and Option Menus can all be TearOff Menus. If the tear-off feature is available on a particular Menu, a TearOffButton with a dashed line representing perforations is shown at the top of the Menu (see Figure 3-8).
Figure 16. A TearOff Menu.
To tear off a Menu:
The Menu is torn off and placed at the location where it originally appeared. You can move it to a new location as you would any other window.
To tear off a Menu and move it to a new location:
After a Menu is torn off, the original Menu is unposted. A torn-off Menu is like an ordinary secondary window. It is decorated with a title bar, window border, and window manager buttons. The torn-off Menu can be repositioned by using the title bar. You can have only one copy of each TearOff Menu at a time. If you tear off a Menu that you have already torn off, the first version will disappear and the new version will replace the older version. At any time, you can post the Menu in its usual location without affecting the torn-off version.
To remove a TearOff Menu, you can select Close from the Window Menu or press Cancel while the input focus is in the TearOff Menu.