MenuItem

A MenuItem is a generic member of every kind of menu (PullDownMenu, 
PullAsideMenu, or MenuBar). A MenuItem is actually a PushButton, but it may 
behave differently depending on the selection method (see entries for the 
PullDownMenu and the PullAsideMenu). Regardless of the selection method, the
activation of a MenuItem causes some action to happen.

One of the selection methods uses a MenuItem's mnemonic. You can install a 
mnemonic for a particular MenuItem with a single resource called "mnemonic" in
the app-defaults file. The value of the resource must be one of the letters in 
the MenuItem's title and should not be the same as any other mnemonic in the 
same menu. For example, you could change the mnemonic of the File PullDownMenu 
to use the 'i' instead of the 'F' as follows:

*file_pulldown.mnemonic:   i

Another selection method uses a MenuItem's accelerator. You can install your 
own accelerator for a particular MenuItem with a single resource called 
"accelerator". The value of the resource should be a simple key sequence (e.g.
Ctrl-M) and should not be the same as any other accelerator in any menu). You
install an accelerator for a specific MenuItem, just like installing a mnemonic.
The accelerator consists of two resources. "accelerator" tells X the activating
key sequence and "acceleratorText" shows the user (on the MenuItem) what the 
key sequence is. For example, to install an accelerator to pop up the 
PreferencesDialog, set these resources on the Preferences MenuItem in the 
Utilities PullDownMenu as follows:

*utilities_pulldown*preferences.accelerator:        Ctrl<Key>p
*utilities_pulldown*preferences.acceleratorText:    Ctrl-P

Refer to the Motif User's Guide for more details on how to specify resources, 
and use the Instance Hierarchy appendix to identify the name of a specific
MenuItem. All MenuItems have entries for their "labelString" resource in the 
app-defaults file already.

Note that a MenuItem cannot be selected when desensitized. A desensitized 
MenuItem has an obscured label. A MenuItem is usually desensitized when the 
action for that item does not make sense in a given context or the action's
objects are not available. For example, the MenuItems that close Sun MTPScan's
connections to Sun MTP systems (in the Summary Screen's File PullDownMenu) are 
desensitized when there is nothing to connect to, eg. when you see the Getting 
Started information.

See also: MenuBar, PullAsideMenu, PullDownMenu, PushButton
