XMMAINWINDOW(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ 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_BAR
  • XmCOMMAND_WINDOW
  • XmMESSAGE_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 to NULL? Then there's just… no message window in your MainWindow. It's giving minimalist, honestly.
  • XmNshowSeparator β€” set it to True and you get separators between the components of the MainWindow ✨. Set it to False and 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 β€” class XmCAutoDragModel, type XtEnum, default XmAUTO_DRAG_ENABLED, access CSG
  • XmNclipWindow β€” class XmCClipWindow, type Widget, default dynamic, access G
  • XmNhorizontalScrollBar β€” class XmCHorizontalScrollBar, type Widget, default dynamic, access CSG
  • XmNscrollBarDisplayPolicy β€” class XmCScrollBarDisplayPolicy, type unsigned char, default dynamic, access CSG
  • XmNscrollBarPlacement β€” class XmCScrollBarPlacement, type unsigned char, default XmBOTTOM_RIGHT, access CSG
  • XmNscrolledWindowMarginHeight β€” class XmCScrolledWindowMarginHeight, type Dimension, default 0, access N/A
  • XmNscrolledWindowMarginWidth β€” class XmCScrolledWindowMarginWidth, type Dimension, default 0, access N/A
  • XmNscrollingPolicy β€” class XmCScrollingPolicy, type unsigned char, default XmAPPLICATION_DEFINED, access CG
  • XmNspacing β€” class XmCSpacing, type Dimension, default 4, access CSG
  • XmNtraverseObscuredCallback β€” class XmCCallback, type XtCallbackList, default NULL, access CSG
  • XmNverticalScrollBar β€” class XmCVerticalScrollBar, type Widget, default dynamic, access CSG
  • XmNvisualPolicy β€” class XmCVisualPolicy, type unsigned char, default dynamic, access G
  • XmNworkWindow β€” class XmCWorkWindow, type Widget, default NULL, access CSG
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 β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG πŸ¦‹
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG πŸ¦‹
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG πŸŽ€
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C πŸ’…
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG ✨
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG ✨
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default NULL, access CSG πŸ‘‘
  • XmNlayoutDirection β€” class XmCLayoutDirection, type XmDirection, default dynamic, access CG 🌈
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmTAB_GROUP, access CSG 🧚
  • XmNpopupHandlerCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C πŸ’€
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 0, access CSG 🌸
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CG 🌈
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG πŸ¦‹
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG πŸ¦‹
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG ⭐
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG πŸ“
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG πŸ’œ
Lowkey important: notice the Access column is not all the same letters. Some of these are CSG, some are CG, and XmNhelpCallback and XmNpopupHandlerCallback are plain C. 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 β€” class XmCReadOnly, type WidgetList, default NULL, access G πŸ‘‘
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default NULL, access CSG 🧚
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G ✨
Heads up: XmNchildren and XmNnumChildren are access G only β€” 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 β€” Class XmCAccelerators, Type XtAccelerators, Default dynamic, Access CSG
  • XmNancestorSensitive β€” Class XmCSensitive, Type Boolean, Default dynamic, Access G
  • XmNbackground β€” Class XmCBackground, Type Pixel, Default dynamic, Access CSG
  • XmNbackgroundPixmap β€” Class XmCPixmap, Type Pixmap, Default XmUNSPECIFIED_PIXMAP, Access CSG
  • XmNborderColor β€” Class XmCBorderColor, Type Pixel, Default XtDefaultForeground, Access CSG
  • XmNborderPixmap β€” Class XmCPixmap, Type Pixmap, Default XmUNSPECIFIED_PIXMAP, Access CSG
  • XmNborderWidth β€” Class XmCBorderWidth, Type Dimension, Default 0, Access CSG
  • XmNcolormap β€” Class XmCColormap, Type Colormap, Default dynamic, Access CG
  • XmNdepth β€” Class XmCDepth, Type int, Default dynamic, Access CG
  • XmNdestroyCallback β€” Class XmCCallback, Type XtCallbackList, Default NULL, Access C
  • XmNheight β€” Class XmCHeight, Type Dimension, Default dynamic, Access CSG
  • XmNinitialResourcesPersistent β€” Class XmCInitialResourcesPersistent, Type Boolean, Default True, Access C
  • XmNmappedWhenManaged β€” Class XmCMappedWhenManaged, Type Boolean, Default True, Access CSG
  • XmNscreen β€” Class XmCScreen, Type Screen *, Default dynamic, Access CG
  • XmNsensitive β€” Class XmCSensitive, Type Boolean, Default True, Access CSG
  • XmNtranslations β€” Class XmCTranslations, Type XtTranslations, Default dynamic, Access CSG
  • XmNwidth β€” Class XmCWidth, Type Dimension, Default dynamic, Access CSG
  • XmNx β€” Class XmCPosition, Type Position, Default 0, Access CSG
  • XmNy β€” Class XmCPosition, Type Position, Default 0, Access CSG
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. πŸ“


the besties it rolls with πŸ‘‘ (go read these next, fr fr):


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. βœ¨πŸ’–πŸŽ€