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



Understanding the Resource Description File

The supplementary mwm resource description file contains specifications for menus, key bindings, and mouse bindings that are referred to by entries in the .Xdefaults file and other files that the window manager uses to create the resource database. If you do not have a .mwmrc file in your home directory, copy the system resource description file into your home directory with the following command:

+--------------------------------------------------------------------------------+
|% cp /usr/lib/X11/system.mwmrc  ~/.mwmrc                                        |
+--------------------------------------------------------------------------------+

You can freely modify the local copy of the resource description file to customize your Motif environment.

The configFile resource specifies the pathname for the mwm resource description file. If the pathname begins with ~/ (a tilde followed by a slash), mwm considers it to be relative to your home directory (as specified by the HOME environment variable). If the LANG environment variable is set, mwm looks for $HOME/$LANG/configFile. If that file does not exist or if LANG is not set, mwm looks for $HOME/configFile. If the configFile pathname does not begin with ~/ (a tilde followed by a slash), mwm considers it to be relative to the current working directory.

User actions, such as keystrokes, are associated with predefined window manager functions. Each function has a name that begins with an f. (f dot) character sequence. In general, the meaning of the function is evident from its name (see Table 6-1). (See the mwm reference page in the Motif Programmer's Reference for more information on these functions.)

Table 22. Window Manger Functions

Function Description
f.beep Causes a beep.
f.cci Controls the placement and naming of client-command interface (CCI) commands generated by applications.
f.circle_down Moves the top window to the bottom of the window stack.
f.circle_up Moves the bottom window to the top of the window stack.
f.exec or ! Executes the following shell command.
f.focus_color Sets the colormap focus to a window.
f.focus_key Sets the keyboard input focus to a window.
f.goto Moves the root window to a specified location.
f.kill Kills an application and its window.
f.lower Moves a window to the bottom of the window stack.
f.maximize Maximizes a window.
f.menu Activates the named menu. This function can be used to create cascading and Popup Menus.
f.minimize Iconifies a window.
f.move Starts an interactive move for a window.
f.next_cmap Installs the next colormap.
f.next_key Moves the keyboard input focus to the next window in the window stack.
f.nop Does nothing.
f.normalize Causes an icon or a maximized window to be displayed at its normal size.
f.normalize_and_raise Causes an icon or a maximized window to be displayed at its normal size and raised to the top of the window stack.
f.pack_icons Reorganizes the icons according to the current icon placement policy.
f.pan Moves the root window a specified amount.
f.pass_keys Toggles the use of special key bindings.
f.post_wmenu Posts the Window Menu.
f.prev_cmap This function installs the previous colormap in the list of colormaps for the window with the colormap focus.
f.prev_key Moves the keyboard input focus to the previous window in the window stack.
f.quit_mwm Exits the window manager without exiting the X Window System.
f.raise Raises a window to the top of the window stack.
f.raise_lower If obscured, raises a window to the top of the window stack; otherwise, lowers it to the bottom of the window stack.
f.refresh Redraws all the windows on the screen.
f.refresh_win Redraws a single window.
f.resize Starts an interactive resize for a window.
f.restart Stops and restarts the window manager.
f.restore Restores an iconified window to its previous state.
f.restore_and_raise Restores an iconified window to its previous state and raises it to the top of its stack.
f.screen Moves a pointer to a specific screen.
f.send_msg Sends a client message to the application.
f.separator Draws a separator in a menu pane.
f.set_behavior Restarts the window manager with the default behavior or reverts to any custom behavior.
f.title Inserts a title in a menu pane.
f.track_pan Continuously moves the root window in the direction of the mouse.

The .mwmrc file defines named groups of key bindings, button bindings, and menu definitions. These groups are referenced by name as values for mwm resources, such as keyBindings and buttonBindings. For example, if you wanted to define alternative responses for mouse button actions, you would create the named set of bindings (for instance, MyButtonBindings) in the .mwmrc file and reference those bindings in your .Xdefaults file as follows:

Mwm*buttonBindings: MyButtonBindings

The following sections describe the syntax for defining menus, key bindings, and button bindings.


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