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. OSF/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 as if you had pulled down a window shade. The most commonly used Pulldown menus in an application are placed on the MenuBar of an application. A typical File menu pulled down from a MenuBar is shown below.
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:
to select the
MenuBar.
,
<Select>, or
to post
the menu.
,
<Select>, or
to
activate the menu item.
You can cancel a menu using the keyboard by pressing
. The input focus will return to
the component that had it prior to the menu interaction. Press
to back out of the menu
hierarchy. If the input focus is in the MenuBar or a menu pulled down
from it,
works just like
. Otherwise,
unposts just the last cascaded
submenu.
In OSF/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 OSF/Motif
Style Guide, such as the Edit, View,
and Options menus.
Using Menu Shortcuts
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 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
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. A typical Pulldown menu that provides both mnemonics and accelerators is shown below.
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:
Popup 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
or
. You can select an item on a Popup
menu with the keyboard by using the arrow keys and pressing
. To cancel a Popup menu from
the keyboard, press
.
Using Option Menus
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. An OptionButton with its
bar graphic and the associated Option menu is shown below.
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
. Select an item on the Option
menu by using the arrow keys and pressing <Select> or
. To cancel an Option menu from
the keyboard, press
.
Using Tear-off Menus
Tear-off menus allow you to keep frequently used menus on the screen. Normally, a menu disappears after you make a selection, but a Tear-off menu remains posted until you cancel it. Tear-off 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 Tear-off 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.
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 Tear-off 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 Tear-off menu, you can select Close
from the window menu or press
while the input focus is in the Tear-off menu.