XMCOMMAND(3)
π XmCommand π
okay so bestie, gather round β this is the manual page for XmCommand, straight out of the library call section of the manual (yes, that XmCommand(library call) header you saw at the top, that's this). It's a whole widget class and she is iconic. Let's get into it π
β¨ NAME β¨
XmCommand β the Command widget class. that's it, that's the name, she's that girl π
πΈ SYNOPSIS πΈ
#include <Xm/Command.h>
that's literally the whole vibe check. include the header and you're in π¦
π« DESCRIPTION π«
okay so here's the tea: Command is a special-purpose composite widget for command entry, and she comes with a built-in command-history mechanism. no cap. she's not just a text box, she's a whole experience. β¨
Command includes, all in one gorgeous package:
- a command-line text-input field π
- a command-line prompt π¬
- and a command-history list region π
One additional WorkArea child may be added to the Command after creation. just the one. she has boundaries, and honestly? respect. π
Whenever a command is entered, it is automatically added to the end of the command-history list and made visible. π₯ This does not change the selected item in the list, if there is one. so if you had something highlighted, she's not gonna yank that from you, she's polite like that π«Ά
Also, quick heads-up bestie: many of the new resources specified for Command are actually SelectionBox resources that have been renamed for clarity and ease of use. so if something feels familiar... it is. she just got a glow-up and a new name π
π Descendants π
Command automatically creates the descendants shown in the following list. 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. π§
ItemsListβ classXmListβ the command-history list region πItemsListSWβ classXmScrolledWindowβ the ScrolledWindow parent ofItemsListπͺSelectionβ classXmLabelGadgetβ the command-line prompt π¬Textβ classXmTextFieldβ the command-line text-input field βοΈ
π Classes π
Command inherits behavior, resources, and traits from Core, Composite, Constraint, XmManager, XmBulletinBoard, and XmSelectionBox. yeah, she comes from a long line of legends, main character energy runs in the family π
The class pointer is xmCommandWidgetClass.
The class name is XmCommand.
πΈ New Resources πΈ
The following list 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).
XmNcommandβ classXmCTextString, typeXmString, default"", accessCSGXmNcommandChangedCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNcommandEnteredCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNhistoryItemsβ classXmCItems, typeXmStringTable, defaultNULL, accessCSGXmNhistoryItemCountβ classXmCItemCount, typeint, default0, accessCSGXmNhistoryMaxItemsβ classXmCMaxItems, typeint, default100, accessCSGXmNhistoryVisibleItemCountβ classXmCVisibleItemCount, typeint, defaultdynamic, accessCSGXmNpromptStringβ classXmCPromptString, typeXmString, defaultdynamic, accessCSG
now let's break each one down, bestie, because the details matter π
XmNcommand Contains the current command-line text. This is the XmNtextString resource in SelectionBox, renamed for Command. This resource can also be modified with XmCommandSetValue and XmCommandAppendValue functions. The command area is a Text widget. βοΈ
XmNcommandChangedCallback Specifies the list of callbacks that is called after each time the value of the command changes. The callback reason is XmCR_COMMAND_CHANGED. This is equivalent to the XmNvalueChangedCallback of the Text widget, except that a pointer to an XmCommandCallbackStructure is passed, and the structure's value member contains the XmString. π
XmNcommandEnteredCallback Specifies the list of callbacks that is called when a command is entered in the Command. The callback reason is XmCR_COMMAND_ENTERED. A pointer to an XmCommandCallback structure is passed. π
XmNhistoryItems Lists XmString items that make up the contents of the history list. This is the XmNlistItems resource in SelectionBox, renamed for Command.
β οΈ okay important: XtGetValues for this resource returns the list items themselves, not a copy of the list items. The application must not free the returned items. don't do it bestie, she will notice π
XmNhistoryItemCount Specifies the number of XmStrings in XmNhistoryItems. This is the XmNlistItemCount resource in SelectionBox, renamed for Command.
The value must not be negative. π«
XmNhistoryMaxItems Specifies the maximum number of items allowed in the history list. Once this number is reached, an existing list item must be removed before a new item can be added to the list. For each command entered, the first list item is removed from the list, so the new command can be added to the list.
The value must be greater than 0 (zero). π«
XmNhistoryVisibleItemCount Specifies the number of items in the history list that should be visible at one time. In effect, it sets the height (in lines) of the history list window. This is the XmNlistVisibleItemCount resource in SelectionBox, renamed for Command.
The value must be greater than 0 (zero). The default is dynamic, based on the height of the list. π
XmNpromptString Specifies a prompt for the command line. This is the XmNselectionLabelString resource in SelectionBox, renamed for Command. The default may vary depending on the value of the XmNlayoutDirection resource and the locale. In the C locale the default is > (right angle bracket). π¬
Okay so real talk, bestie β now that some default localized label strings are being handed out through message catalogs for the children of composite widgets, you cannot set the labelString resources on the child through default resource files anymore. Nope. Not happening. π
ββοΈ Instead, you have to use the resource that's provided at the parent level. That's the move. That's the whole vibe. π
β¨ Inherited Resources β¨
Command inherits behavior and resources from the superclasses listed in the tables below. For a complete description of each resource, go read the reference page for that superclass β it's giving β¨required readingβ¨, iykyk.
πΈ XmSelectionBox Resource Set πΈ
Every row is <pink>Name</pink> β <purple>Class</purple> β <cyan>Type</cyan> β <mint>Default</mint> β <peach>Access</peach>, in that order. No skipping, no cap. π
XmNapplyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessN/AXmNapplyLabelStringβ classXmCApplyLabelString, typeXmString, defaultdynamic, accessN/AXmNcancelCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessN/AXmNcancelLabelStringβ classXmCCancelLabelString, typeXmString, defaultdynamic, accessN/AXmNchildPlacementβ classXmCChildPlacement, typeunsigned char, defaultXmPLACE_ABOVE_SELECTION, accessCSGXmNdialogTypeβ classXmCDialogType, typeunsigned char, defaultXmDIALOG_COMMAND, accessGXmNhelpLabelStringβ classXmCHelpLabelString, typeXmString, defaultdynamic, accessN/AXmNlistItemCountβ classXmCItemCount, typeint, default0, accessCSGXmNlistItemsβ classXmCItems, typeXmStringTable, defaultNULL, accessCSGXmNlistLabelStringβ classXmCListLabelString, typeXmString, defaultNULL, accessN/AXmNlistVisibleItemCountβ classXmCVisibleItemCount, typeint, defaultdynamic, accessCSGXmNminimizeButtonsβ classXmCMinimizeButtons, typeBoolean, defaultFalse, accessN/AXmNmustMatchβ classXmCMustMatch, typeBoolean, defaultFalse, accessN/AXmNnoMatchCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessN/AXmNokCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessN/AXmNokLabelStringβ classXmCOkLabelString, typeXmString, defaultdynamic, accessN/AXmNselectionLabelStringβ classXmCSelectionLabelString, typeXmString, defaultdynamic, accessCSGXmNtextAcceleratorsβ classXmCTextAccelerators, typeXtAccelerators, defaultdefault, accessCXmNtextColumnsβ classXmCColumns, typeshort, defaultdynamic, accessCSGXmNtextStringβ classXmCTextString, typeXmString, default"", accessCSG
π«Ά Pro bestie tip: those dynamic defaults are literally just doing the most, so don't hardcode assumptions about them, okay? Read the superclass page. β¨
β¨ XmBulletinBoard Resource Set β¨
okay bestie, welcome to the resource set for XmBulletinBoard π this is literally the master list of every property you can set on a bulletin board widget, and it's giving very organized. the columns are Name, Class, Type, Default, and Access β no cap. here's every single one, in order, so you don't miss a thing:
XmNallowOverlapβ Class:XmCAllowOverlap, Type:Boolean, Default:True, Access:CSGβ¨XmNautoUnmanageβ Class:XmCAutoUnmanage, Type:Boolean, Default:False, Access:N/AπXmNbuttonFontListβ Class:XmCButtonFontList, Type:XmFontList, Default:dynamic, Access:N/AπXmNbuttonRenderTableβ Class:XmCButtonRenderTable, Type:XmRenderTable, Default:dynamic, Access:CSGπ¦XmNcancelButtonβ Class:XmCWidget, Type:Widget, Default:NULL, Access:N/AπΈXmNdefaultButtonβ Class:XmCWidget, Type:Widget, Default:NULL, Access:N/AπXmNdefaultPositionβ Class:XmCDefaultPosition, Type:Boolean, Default:False, Access:CSGβXmNdialogStyleβ Class:XmCDialogStyle, Type:unsigned char, Default:dynamic, Access:CSGπXmNdialogTitleβ Class:XmCDialogTitle, Type:XmString, Default:NULL, Access:CSGπXmNfocusCallbackβ Class:XmCCallback, Type:XtCallbackList, Default:NULL, Access:Cπ₯XmNlabelFontListβ Class:XmCLabelFontList, Type:XmFontList, Default:dynamic, Access:CSGπXmNlabelRenderTableβ Class:XmCLabelRenderTable, Type:XmRenderTable, Default:dynamic, Access:CSGπ§XmNmapCallbackβ Class:XmCCallback, Type:XtCallbackList, Default:NULL, Access:CπXmNmarginHeightβ Class:XmCMarginHeight, Type:Dimension, Default:10, Access:CSGπ«ΆXmNmarginWidthβ Class:XmCMarginWidth, Type:Dimension, Default:10, Access:CSGπXmNnoResizeβ Class:XmCNoResize, Type:Boolean, Default:False, Access:CSGπXmNresizePolicyβ Class:XmCResizePolicy, Type:unsigned char, Default:XmRESIZE_NONE, Access:CSGπ₯XmNshadowTypeβ Class:XmCShadowType, Type:unsigned char, Default:XmSHADOW_OUT, Access:CSGβ¨XmNtextFontListβ Class:XmCTextFontList, Type:XmFontList, Default:dynamic, Access:CSGπXmNtextRenderTableβ Class:XmCTextRenderTable, Type:XmRenderTable, Default:dynamic, Access:CSGπXmNtextTranslationsβ Class:XmCTranslations, Type:XtTranslations, Default:NULL, Access:CπXmNunmapCallbackβ Class:XmCCallback, Type:XtCallbackList, Default:NULL, Access:Cπ¦
π«Ά The XmManager Resource Set π«Ά
okay bestie, here's the whole menu of resources that XmManager brings to the table, no cap. name, class, type, default, access β all of it, exactly as it is:
XmNbottomShadowColorβ classXmCBottomShadowColor, type Pixel, defaultdynamic, accessCSGπXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, type Pixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGβ¨XmNforegroundβ classXmCForeground, type Pixel, defaultdynamic, accessCSGπXmNhelpCallbackβ classXmCCallback, type XtCallbackList, defaultNULL, accessCπΈXmNhighlightColorβ classXmCHighlightColor, type Pixel, defaultdynamic, accessCSGπ¦XmNhighlightPixmapβ classXmCHighlightPixmap, type Pixmap, defaultdynamic, accessCSGπ«ΆXmNinitialFocusβ classXmCInitialFocus, type Widget, defaultdynamic, accessCSGβXmNlayoutDirectionβ classXmCLayoutDirection, type XmDirection, defaultdynamic, accessCGπXmNnavigationTypeβ classXmCNavigationType, type XmNavigationType, defaultXmTAB_GROUP, accessCSGπ₯XmNpopupHandlerCallbackβ classXmCCallback, type XtCallbackList, defaultNULL, accessCπXmNshadowThicknessβ classXmCShadowThickness, type Dimension, defaultdynamic, accessCSGπXmNstringDirectionβ classXmCStringDirection, type XmStringDirection, defaultdynamic, accessCGπXmNtopShadowColorβ classXmCTopShadowColor, type Pixel, defaultdynamic, accessCSGβ¨XmNtopShadowPixmapβ classXmCTopShadowPixmap, type Pixmap, defaultdynamic, accessCSGπXmNtraversalOnβ classXmCTraversalOn, type Boolean, defaultTrue, accessCSGπ¦XmNunitTypeβ classXmCUnitType, type unsigned char, defaultdynamic, accessCSGπΈXmNuserDataβ classXmCUserData, type XtPointer, defaultNULL, accessCSGπ
π The Composite Resource Set π
and then Composite rolls up with its own lil trio of resources, periodt:
XmNchildrenβ classXmCReadOnly, type WidgetList, defaultNULL, accessGπ«ΆXmNinsertPositionβ classXmCInsertPosition, type XtOrderProc, defaultNULL, accessCSGβXmNnumChildrenβ classXmCReadOnly, type Cardinal, default0, accessGπXmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessN/Aβ¨XmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGπXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCGπXmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCGπ¦XmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSGπ
π«Ά Callback Information π«Ά
bestie a pointer to the following structure gets handed to every single callback, no exceptions:
typedef struct
{
int reason;
XEvent * event;
XmString value;
int length;
} XmCommandCallbackStruct;
reasonβ tells you why the callback got invoked, like the lore drop of the moment πeventβ points to theXEventthat triggered the callback, the whole origin story frvalueβ theXmStringsitting in the CommandArea, i.e. the actual textlengthβ the size in bytes of theXmStringvalue. and listen, this member is obsolete β it's just hanging around for compatibility with earlier releases, like a legacy fit we keep in the back of the closet π
πΈ Translations πΈ
XmCommand inherits translations from XmSelectionBox. it's giving family resemblance, it's giving inherited genes π
β Accelerators β
The XmNtextAccelerators from XmSelectionBox are added to the Text descendant of XmCommand. so the Text widget down the family tree gets them too, iconic behaviour honestly
π Action Routines π
the XmCommand action routines are, drumroll please:
SelectionBoxUpOrDown(Previous|Next|First|Last)β the main character of this section, and here's exactly what it does:- When called with an argument of
Previous, or0(zero) for compatibility, it selects the previous item in the history list and replaces the text with that item. lowkey time travel, going back a step π°οΈ - When called with an argument of
Next, or1for compatibility, it selects the next item in the history list and replaces the text with that item. forward momentum, slay π₯
- When called with an argument of
okay bestie, picking up right where we left off in the action list π
- when you call it with an argument of
First, or2for compatibility, it selects the first item in the history list and replaces the text with that item. periodt. - when you call it with an argument of
Last, or3for compatibility, it selects the last item in the history list and replaces the text with that item. sheβs consistent. - calls the callbacks for
XmNcommandChangedCallback. not me being the messenger of callback tea β¨
Additional Behavior π
the Command widget also has this extra behavior, no cap:
<Key><osfCancel>β if the parent of the Command is a manager, the event is passed to the parent. lowkey passing the vibe along.<Key><osfActivate>in Text β calls the Text widget'sXmNactivateCallbackcallbacks. if the text is empty, this action then returns. otherwise, if the history list hasXmNhistoryMaxItemsitems, it removes the first item in the list. it adds the text to the history list as the last item, clears the text, and calls theXmNcommandEnteredCallbackcallbacks. iconic behavior fr fr.<Key>in Text β when any change is made to the text edit widget, this action calls the callbacks forXmNcommandChangedCallback. it's literally always watching π.<BtnDown>(2+)or<Key><osfActivate>in List β calls the List widget'sXmNdefaultActionCallbackcallbacks. if the history list hasXmNhistoryMaxItemsitems, this action removes the first item in the list. it adds the selected List item to the history list as the last item, clears the text, and calls theXmNcommandEnteredCallbackcallbacks. slay.<FocusIn>β calls the callbacks forXmNfocusCallback. focus queen π.<MapWindow>β when a Command that is the child of a DialogShell is mapped, this action calls the callbacks forXmNmapCallback. mapping = main character energy.<UnmapWindow>β when a Command that is the child of a DialogShell is unmapped, this action calls the callbacks forXmNunmapCallback. unmapped but still valid π .
Virtual Bindings π¦
the bindings for virtual keys are vendor specific. for information about bindings for virtual buttons and keys, see VirtualBindings(3). iykyk.
β¨ RELATED β¨
Composite(3)Constraint(3)Core(3)XmBulletinBoard(3)XmCommandAppendValue(3)XmCommandError(3)XmCommandGetChild(3)XmCommandSetValue(3)XmCreateCommand(3)XmManager(3)XmSelectionBox(3)XmVaCreateCommand(3)XmVaCreateManagedCommand(3)
kisses, this was the XmCommand(library call) manual page, no date because sheβs timeless π
π¦ 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