[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide



Modifying the Window Menu

All window manager menus are defined using the following syntax:

Menu 
 
menu_name
 
{
 
 
 
item1 [
 
mnemonic] [
 
accelerator] 
 
function [
 
argument]
 
 
 
item2 [
 
mnemonic] [
 
accelerator] 
 
function [
 
argument]
 
 
 
item# [
 
mnemonic] [
 
accelerator] 
 
function [
 
argument]
 
}

The menu is given a name, and each item in the menu is given a name or graphic representation (bitmap). The item is followed by an optional mnemonic or accelerator or both, and then by one of the window manager functions listed in Table 6-1. The function is the action that the window manager takes when that menu item is selected. Some functions require an argument.

The default Window Menu definition as it appears in the /usr/lib/X11/system.mwmrc file is as follows:

Menu DefaultWindowMenu



{


Restore _R Alt<Key>F5 f.normalize
Move _M Alt<Key>F7 f.move
Size _S Alt<Key>F8 f.resize
Minimize _n Alt<Key>F9 f.minimize
Maximize _x Alt<Key>F10 f.maximize
Lower _L Alt<Key>F3 f.lower
no-label

f.separator
Close _C Alt<Key>F4 f.kill
}


Not all applications require each one of these default functions. For example, if you have a real-time application, it should never be iconified. The Motif Window Manager allows you to specify a Window Menu for each application you are using.

To modify the default Window Menu, begin by copying the DefaultWindowMenu definition from the /usr/lib/X11/system.mwmrc file to the .mwmrc file in your home directory. Rename the default menu definition (MailWindowMenu, for example) and make the appropriate changes, following the syntax shown at the beginning of this section.

Then you need to reference the alternate Window Menu definition in your .Xdefaults file by using the windowMenu resource:

Mwm*my_mail_program*windowMenu: MailWindowMenu

Remember that you need to restart mwm for your version of the menu to appear.

Note that the menu item names you specify in the .mwmrc file can be overridden by applications that rename menu item names.


[ Previous | Next | Contents | Glossary | Home | Search ]