Next | Prev | Up | Top | Contents | Index

Shell Classes

Shell classes are used to define resources and behaviors that are common to all widgets having their own window, such as top-level windows, popup menus, and dialogs. Motif describes several different base classes for this purpose, some inherited from Xt, and some defined inside Motif. All the shell classes are introduced below, followed by tables showing the resources available for each.

Shell is the ancestor of all the other abstract shell classes. Having only one managed child, it encapsulates interaction with the window manager. Shell inherits behavior and resources from the Composite and Core classes.

Shell Resources
Resource NameDefault ValueType or Legal Value
-allowShellResizeFalseBoolean
-geometry""String
-overrideRedirectFalseBoolean
-saveUnderFalseBoolean
-visualInheritedString

WMShell handles protocols that communicate between an application and the window manager. WMShell inherits behavior and resources from Core, Composite, and Shell.

WMShell Resources
Resource NameDefault ValueType or Legal Value
-baseHeightnoneInteger
-baseWidthnoneInteger
-heightIncnoneInteger
-iconMasknonePixmap
-iconPixmapnonePixmap
-iconWindownoneWindow
-iconX-1Integer
-iconY-1Integer
-initialStatenormalStateiconicState
normalState
-inputFalseBoolean
-maxAspectXnoneInteger
-maxAspectYnoneInteger
-maxHeightnoneInteger
-maxWidthnoneInteger
-minAspectXnoneInteger
-minAspectYnoneInteger
-minHeightnoneInteger
-minWidthnoneInteger
-titleargv[0]String
-titleEncodingxa_stringcompound_text
xa_string
-transientFalseBoolean
-waitForWmTrueBoolean
-widthIncnoneInteger
-windowGroup Window
-winGravitydynamicInteger
-wmTimeout5000msInteger

VendorShell controls resources set up in the X server, and contains meaningful defaults for a particular implementation.VendorShell inherits behavior and resources from the Core, Composite, Shell, and WMShell classes.

VendorShell Resources
Resource NameDefault ValueType or Legal Value
-defaultFontListdynamicfont list
-deleteResponsedestroydo_nothing
unmap
destroy
-keyboardFocusPolicyexplicitexplicit
pointer
-mwmDecorations-1Integer
-mwmFunctions-1Integer
-mwmInputMode-1Integer
-mwmMenu""String
-shellUnitTypepixelspixels
100th_millimeters
1000th_inches
100th_points
100th_font_units
-useAsyncGeometryFalseBoolean

TopLevelShell is used for normal top-level windows such as additional window widgets that an application needs. This level is responsible for iconization. TopLevelShell inherits behavior and resources from Core, Composite, Shell, WMShell, and VendorShell.

TopLevelShell Resources
Resource NameDefault ValueType or Legal Value
-iconicFalseBoolean
-iconName""String
-iconNameEncodingxa_stringcompound_text
xa_string

ApplicationShell is used for an application's main top-level window. There should be more than one of these only if a program implements multiple logical applications. ApplicationShell inherits behavior and resources from Core, Composite, Shell, WMShell, VendorShell, and TopLevelShell.

ApplicationShell Resources
Resource NameDefault ValueType or Legal Value
-argcSet by XtInitialize()Integer
-argvSet by XtInitialize()String Array

TransientShell is for temporary windows that do not stay visible on screen and must be iconized along with the TopLevelShell they are affiliated with. TransientShell inherits behavior and resources from Core, Composite, Shell, WMShell, and VendorShell.

TransientShell Resources
Resource NameDefault ValueType or Legal Value
transientFornoneWidget


Window Sizing

Window sizing constraints may be set either according to the dimensions of a window, or on its aspect ratio (the proportion of width to height). Beside minimum and maximum dimensions, window size may be constrained to follow a given increment.

For instance, using the following setting, the only width allowed for interactive resizing is 150 and 250:

-minWidth 100 -baseWidth 50 -widthInc 100 -maxWidth 300

Window aspect ratios are set using a numerator/denominator formula:

minAspectX width maxAspectX ---------- <= ----- <= ---------- minAspectY height maxAspectY

Hence, the following constrains the width to stay between a third and half the height:

-minAspectX 1 -minAspectY 3 -maxAspectX 1 -maxAspectY 2

Interactive window resizing may also be ignored by setting the -allowShellResize resource to False.

Window icon resources may be used to define the window icon type, its placement, and so forth.

Icons may be drawn using a (possibly partially transparent) pixmap, or by using a specific alternate window (-iconWindow). A window may be set up to appear in iconic state at creation (-initialState iconicState), and its current state may be retrieved or changed using the -iconic resource.


Next | Prev | Up | Top | Contents | Index