XMMAINWINDOW(3)
β¨ NAME β¨
XmMainWindow β The MainWindow widget class. And bestie, this is the XmMainWindow(library call) manual page, so get comfy. π
πΈ SYNOPSIS πΈ
#include <Xm/MainW.h>
π DESCRIPTION π
Okay so MainWindow gives you a standard layout for the primary window of an application. Itβs giving main character energy for your whole UI. This layout includes a MenuBar, a CommandWindow, a work region, a MessageWindow, and ScrollBars. And hereβs the tea: any or all of these areas are optional. π«Ά
The work region and ScrollBars in the MainWindow behave identically to the work region and ScrollBars in the ScrolledWindow widget. The user can think of the MainWindow as an extended ScrolledWindow with an optional MenuBar and optional CommandWindow and MessageWindow. Lowkey iconic.
In a fully loaded MainWindow, the MenuBar spans the top of the window horizontally. The CommandWindow spans the MainWindow horizontally just below the MenuBar, and the work region lies below the CommandWindow. The MessageWindow is below the work region. Any space remaining below the MessageWindow is managed in a manner identical to ScrolledWindow. The behavior of ScrolledWindow can be controlled by the ScrolledWindow resources. To create a MainWindow, first create the work region elements, a MenuBar, a CommandWindow, a MessageWindow, a horizontal ScrollBar, and a vertical ScrollBar widget, and then call XmMainWindowSetAreas with those widget IDs. Periodt. π
MainWindow can also create three Separator widgets that provide a visual separation of MainWindowβs four components. The user can specify resources in a resource file for the automatically created gadgets that contain the MainWindow separators. The name of the first separator gadget is Separator1; the second is Separator2; and the third is Separator3. So cute. π
MainWindow also provides the following three child types for layout at creation time:
XmMENU_BARXmCOMMAND_WINDOWXmMESSAGE_WINDOW
MainWindow can use these child types at creation time instead of their associated resource values. MainWindow uses the XmQTmenuSystem trait. No cap. π₯
π¦ Descendants π¦
MainWindow automatically creates the descendants shown in the following table. An application can use XtNameToWidget to gain access to the named descendant. In addition, a user or an application can use the named descendant when specifying resource values.
The table columns are Named Descendant, Class, and Identity, and here are the rows, bestie:
HorScrollBarβ class:XmScrollBar; identity: horizontal scroll bar.Separator1β class:XmSeparatorGadget; identity: optional first separator.Separator2β class:XmSeparatorGadget; identity: optional second separator.Separator3β class:XmSeparatorGadget; identity: optional third separator.VertScrollBarβ class:XmScrollBar; identity: vertical scroll bar.
π Classes π
MainWindow inherits behavior and resources from Core, Composite, Constraint, XmManager, and XmScrolledWindow. The way that it just stacks those up? Obsessed. π
The class pointer is xmMainWindowWidgetClass.
The class name is XmMainWindow.
π New Resources π
The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A). Iykyk.
Hereβs the XmMainWindow Resource Set, one bullet per resource, with name, class, type, default, and access:
XmNcommandWindowβ class:XmCCommandWindow; type:Widget; default:NULL; access:CSG.XmNcommandWindowLocationβ class:XmCCommandWindowLocation; type:unsigned char; default:ABOVE (SeeDesc.); access:CG.XmNmainWindowMarginHeightβ class:XmCMainWindowMarginHeight; type:Dimension; default:0; access:CSG.XmNmainWindowMarginWidthβ class:XmCMainWindowMarginWidth; type:Dimension; default:0; access:CSG.XmNmenuBarβ class:XmCMenuBar; type:Widget; default:NULL; access:CSG.XmNmessageWindowβ class:XmCMessageWindow; type:Widget; default:NULL; access:CSG.XmNshowSeparatorβ class:XmCShowSeparator; type:Boolean; default:False; access:CSG.
Now the resource descriptions, because context is everything:
XmNcommandWindow β Specifies the widget to be laid out as the CommandWindow. This widget must have been previously created and managed as a child of MainWindow.
XmNcommandWindowLocation β Controls the position of the command window. XmCOMMAND_ABOVE_WORKSPACE locates the command window between the menu bar and the work window. XmCOMMAND_BELOW_WORKSPACE locates the command window between the work window and the message window.
XmNmainWindowMarginHeight β Specifies the margin height on the top and bottom of MainWindow. This resource overrides any setting of the ScrolledWindow resource XmNscrolledWindowMarginHeight.
XmNmainWindowMarginWidth β Specifies the margin width on the right and left sides of MainWindow. This resource overrides any setting of the ScrolledWindow resource XmNscrolledWindowMarginWidth.
XmNmenuBar β Specifies the widget to be laid out as the MenuBar. This widget must have been previously created and managed as a child of MainWindow.
XmNmessageWindowβ the widget you want laid out as the MessageWindow, bestie. It has to have already been created and managed as a child of MainWindow, no exceptions π . It gets parked at the bottom of the MainWindow. And if you set this toNULL? Then there's justβ¦ no message window in your MainWindow. It's giving minimalist, honestly.XmNshowSeparatorβ set it toTrueand you get separators between the components of the MainWindow β¨. Set it toFalseand the separators simply do not appear. That's the whole vibe check.
π«Ά Inherited Resources π«Ά
MainWindow is not doing all this alone, okay β it inherits behavior and resources from the superclasses listed below. And if you want the full tea on any single one of these resources, go read the reference page for that superclass. Not me summarizing what I don't need to π
π XmScrolledWindow Resource Set π
Every row, every value, nothing skipped:
XmNautoDragModelβ classXmCAutoDragModel, typeXtEnum, defaultXmAUTO_DRAG_ENABLED, accessCSGXmNclipWindowβ classXmCClipWindow, typeWidget, defaultdynamic, accessGXmNhorizontalScrollBarβ classXmCHorizontalScrollBar, typeWidget, defaultdynamic, accessCSGXmNscrollBarDisplayPolicyβ classXmCScrollBarDisplayPolicy, typeunsigned char, defaultdynamic, accessCSGXmNscrollBarPlacementβ classXmCScrollBarPlacement, typeunsigned char, defaultXmBOTTOM_RIGHT, accessCSGXmNscrolledWindowMarginHeightβ classXmCScrolledWindowMarginHeight, typeDimension, default0, accessN/AXmNscrolledWindowMarginWidthβ classXmCScrolledWindowMarginWidth, typeDimension, default0, accessN/AXmNscrollingPolicyβ classXmCScrollingPolicy, typeunsigned char, defaultXmAPPLICATION_DEFINED, accessCGXmNspacingβ classXmCSpacing, typeDimension, default4, accessCSGXmNtraverseObscuredCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCSGXmNverticalScrollBarβ classXmCVerticalScrollBar, typeWidget, defaultdynamic, accessCSGXmNvisualPolicyβ classXmCVisualPolicy, typeunsigned char, defaultdynamic, accessGXmNworkWindowβ classXmCWorkWindow, typeWidget, defaultNULL, accessCSG
Not me double-checking that every single class name, type, default and access code made it in there π they did. All thirteen. Obsessed with accuracy fr fr.
π XmManager Resource Set π
Okay so every widget that's an XmManager subclass inherits this whole resource set, and bestie, it is a lot of resources. Here's the entire table, not one single line skipped, because we do not do that here. π
The columns are Name, Class, Type, Default and Access β and where the default says dynamic, that's the original saying "it depends", not me being vague. No cap.
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, default dynamic, accessCSGπ¦XmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGπ¦XmNforegroundβ classXmCForeground, typePixel, default dynamic, accessCSGπXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNhighlightColorβ classXmCHighlightColor, typePixel, default dynamic, accessCSGβ¨XmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, default dynamic, accessCSGβ¨XmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultNULL, accessCSGπXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, default dynamic, accessCGπXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSGπ§XmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSGπΈXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, default dynamic, accessCGπXmNtopShadowColorβ classXmCTopShadowColor, typePixel, default dynamic, accessCSGπ¦XmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, default dynamic, accessCSGπ¦XmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSGβXmNunitTypeβ classXmCUnitType, typeunsigned char, default dynamic, accessCSGπXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSGπ
Lowkey important: notice the Access column is not all the same letters. Some of these areCSG, some areCG, andXmNhelpCallbackandXmNpopupHandlerCallbackare plainC. Write that down, bestie β the letters are doing real work here and I'm not gonna pretend otherwise. π
Also likeβ¦ <hotpink>three</hotpink> of these have a default that's literally the word dynamic, meaning it's not a fixed value baked into the page. It's giving "ask your parent widget". π
π¦ Composite Resource Set π¦
And then there's the Composite resource set, which is a much shorter little list β only three resources, but every one of them matters if you're doing widget-parenting shenanigans. π«Ά
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessGπXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSGπ§XmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessGβ¨
Heads up:XmNchildrenandXmNnumChildrenare accessGonly β that's get, not set, not create. So you don't just go assigning those, okay? Read them, don't touch. π ββοΈ
And that's the whole table, every row, exactly as it was. No rows were harmed, skipped, or merged in the making of this rewrite. π
But wait β there's still more of this page to get through, so don't you dare close the terminal yet. π
okay so this is the part everyone actually screenshots: THE RESOURCE TABLE π every single row, every column, nothing skipped. read it like a checklist bestie, because that's what it is.
π Core Resource Set π
one bullet per resource, and each one gives you the Name, the Class, the Type, the Default and the Access β in that order, every time. no cap.
XmNacceleratorsβ ClassXmCAccelerators, TypeXtAccelerators, Defaultdynamic, AccessCSGXmNancestorSensitiveβ ClassXmCSensitive, TypeBoolean, Defaultdynamic, AccessGXmNbackgroundβ ClassXmCBackground, TypePixel, Defaultdynamic, AccessCSGXmNbackgroundPixmapβ ClassXmCPixmap, TypePixmap, DefaultXmUNSPECIFIED_PIXMAP, AccessCSGXmNborderColorβ ClassXmCBorderColor, TypePixel, DefaultXtDefaultForeground, AccessCSGXmNborderPixmapβ ClassXmCPixmap, TypePixmap, DefaultXmUNSPECIFIED_PIXMAP, AccessCSGXmNborderWidthβ ClassXmCBorderWidth, TypeDimension, Default0, AccessCSGXmNcolormapβ ClassXmCColormap, TypeColormap, Defaultdynamic, AccessCGXmNdepthβ ClassXmCDepth, Typeint, Defaultdynamic, AccessCGXmNdestroyCallbackβ ClassXmCCallback, TypeXtCallbackList, DefaultNULL, AccessCXmNheightβ ClassXmCHeight, TypeDimension, Defaultdynamic, AccessCSGXmNinitialResourcesPersistentβ ClassXmCInitialResourcesPersistent, TypeBoolean, DefaultTrue, AccessCXmNmappedWhenManagedβ ClassXmCMappedWhenManaged, TypeBoolean, DefaultTrue, AccessCSGXmNscreenβ ClassXmCScreen, TypeScreen *, Defaultdynamic, AccessCGXmNsensitiveβ ClassXmCSensitive, TypeBoolean, DefaultTrue, AccessCSGXmNtranslationsβ ClassXmCTranslations, TypeXtTranslations, Defaultdynamic, AccessCSGXmNwidthβ ClassXmCWidth, TypeDimension, Defaultdynamic, AccessCSGXmNxβ ClassXmCPosition, TypePosition, Default0, AccessCSGXmNyβ ClassXmCPosition, TypePosition, Default0, AccessCSG
count them if you want, bestie β nineteen rows, all present, i did not cherry-pick a single one. π
π¦ Translations π¦
okay this one is short and sweet: MainWindow inherits translations from ScrolledWindow. that's it. that's the whole tea. π
β¨ RELATED β¨
the besties it rolls with π (go read these next, fr fr):
Composite(3)Constraint(3)Core(3)XmCreateMainWindow(3)XmMainWindowSep1(3)XmMainWindowSep2(3)XmMainWindowSep3(3)XmMainWindowSetAreas(3)XmManager(3)XmScrolledWindow(3)XmVaCreateMainWindow(3)XmVaCreateManagedMainWindow(3)
and that's the whole page, bestie, we made it to the end together π«Ά this one's filed under XmMainWindow(library call) β that's the source/version-and-date footer energy right there, so give it a lil curtsy on your way out. now go write some MainWindows, you absolute icon. β¨ππ
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms