[Contents] [Index] [Next] [Previous]

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 a window manager function. 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 (to 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 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.