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


Users of X Window System applications normally employ a window manager, a special application that may control the positions, sizes, and border decorations of top-level windows on the display. Motif supplies its own window manager, the Motif Window Manager (MWM), but Motif applications can cooperate with other window managers as well.

A window manager communicates with other applications through a protocol defined in an X Window System document, the Inter-Client Communication Conventions Manual (ICCCM). Xt and Motif define a group of widgets whose main responsibility is to envelop other widgets and communicate with the window manager. These widgets are called shells.

A shell is nearly invisible to the application. Each shell has a single managed child, and the shell's window usually remains coincident with the child's window. The application must create shells when needed, but many Motif convenience routines that create widgets also create shells automatically. Once it has created a shell, the application may not need to handle the shell again. For example, an application can position or resize a Motif shell by positioning or resizing the child widget.

Each widget with a top-level window--that is, a window whose parent is the root window of the screen--needs to be enclosed in a shell. This is true of the main application widget, but it is also true of dialogs, menus, and any top-level widgets other than the main application widget. Motif provides three classes of shell: VendorShell, DialogShell, and MenuShell.


VendorShell is the shell class that provides Motif-specific behavior for shells other than those surrounding menus. It is responsible for communication between the application and MWM. VendorShell is a superclass for other classes. TopLevelShell is an Xt subclass of VendorShell that surrounds a top-level widget in an application. ApplicationShell is another Xt subclass of VendorShell that surrounds the main widget in the application.

Many applications create only one ApplicationShell. A program can create this shell explicitly, or it can use the Xt convenience routine XtAppInitialize to initialize the application and automatically create the ApplicationShell.


A DialogShell is a VendorShell subclass that envelops dialogs. Although the window manager takes account of dialogs, they are usually transient; they appear to provide information to or solicit information from the user, and then they disappear. DialogShell is a subclass of the Xt TransientShell class, which keeps track of the application to which the dialog belongs. Users cannot iconify a dialog separately from the main application window.

DialogShell is designed to have a child that is a subclass of BulletinBoard. Most Motif convenience routines that create dialogs create DialogShell parents automatically.


MenuShell is the class of shell that surrounds PopupMenus and PulldownMenus. MenuShell is a subclass of the Xt OverrideShell class. This class enables the shell to bypass the window manager. Most Motif convenience routines that create PopupMenus and PulldownMenus create MenuShell parents automatically.

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