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

Shells and Their Children

Shell widgets encapsulate application widgets, principally to communicate with the window manager. Motif has three shell classes based on Intrinsics shell classes:


Subclass of WMShell and superclass for other shell classes that contain both persistent top-level widgets and dialogs


Subclass of TransientShell (which is a subclass of VendorShell) used to contain dialog widgets, commonly subclasses of XmBulletinBoard


Subclass of OverrideShell used to contain RowColumn PulldownMenu and PopupMenu widgets

A shell has only one managed child. Except when a shell contains an off-the-spot input method, the shell's window is coincident with the child's window. The geometry_manager procedures of the shell classes treat geometry requests from the child as geometry requests for the shell, and the resize procedures of the shell classes make the child the same size as the shell. Applications should usually change the geometry of the child, not of the shell.

In particular, setting XmNheight, XmNwidth, or XmNborderWidth for either a shell or its child sets that resource to the same value in both the parent and the child. For a child of a shell, setting XmNx or XmNy sets the corresponding resource of the parent but does not change the child's position relative to the parent. XtGetValues for the child's XmNx or XmNy yields the value of the corresponding resource in the parent. The x and y coordinates of the child's upper left outside corner relative to the parent's upper left inside corner are both zero minus the value of XmNborderWidth.

The exception is a VendorShell or DialogShell that contains an off-the-spot input method. In this case, the input method appears inside the shell and below the application widget. The conventions for geometry parameters are the same as for other shells, except that the values of XmNheight for the child and the shell are not identical. The height of the shell is the sum of the height and border width of the application window and the height of the area occupied by the input method.

When the Shell resource XmNallowShellResize is False, a shell's geometry_manager procedure returns XtGeometryNo for all geometry requests from a realized child.

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