Next | Prev | Up | Top | Contents | Index

xmMainWindow

This composite widget is used for the application's main window. As you add children to it (xmMenuBar, xmList, xmMessageBox, a work area, and so forth) it manages them, as you could do manually with xmForm.

The management of the work area is not immediate: the main window must know which of its children is the work area before you can manage that widget. The following example produces a prototype interface for a standard application:

#! /usr/sgitcl/bin/moat 
xtAppInitialize
xmMainWindow .top -showSeparator True \
        -commandWindowLocation command_below_workspace
xmMenuBar .top.bar managed
xmCascadeButton .top.bar.File managed 
xmCascadeButton .top.bar.Help managed
xmDrawingArea .top.work \
        -width 320 -height 240 \
        -background black
.top setValues -workWindow .top.work
.top.work manageChild
xmCommand .top.com managed \
        -historyVisibleItemCount 0 \
        -textFontList  -*-courier-medium-r-*--12-*-*-*-*-*-*
.top.com commandEnteredCallback {%value}
.top setValues -width 600 -height 500
.top manageChild
. realizeWidget
. mainLoop
The xmMainWindow widget defines these resources, renaming resources of the parents, as shown in Table 4-50.

xmMainWindow Resources
Resource NameDefault ValueType or Legal Values
-commandWindownoneWidget
-commandWindowLocationabovecommand_above_workspace
command_below_workspace
-mainWindowMarginHeight0Dimension
-mainWindowMarginWidth0Dimension
-menuBarnoneWidget
-messageWindownoneWidget
-showSeparatorFalseBoolean

Table 4-51 lists the callbacks associated with xmMainWindow.

xmMainWindow Callbacks
Method NameWhy
commandChangedCallbackYou typed some new text, recalled a history item, etc.
commandEnteredCallbackYou typed <Enter>, double-clicked the mouse, etc.
focusCallbackThe window gained input focus.
mapCallbackThe window was mapped on screen.
unmapCallbackThe window was unmapped.


Next | Prev | Up | Top | Contents | Index