XMCONTAINER(3)
π XmContainer β The Container widget class π
okay bestie, welcome to the library call manual for XmContainer. this is the whole vibe, no skips, fr fr. π«Ά
πΈ NAME πΈ
XmContainer β The Container widget class. periodt. π
π¦ SYNOPSIS π¦
#include <Xm/Container.h>
π DESCRIPTION π
okay so Container manages child widgets that have the ContainerItem trait. no cap. These child widgets can be viewed in several different layout formats, selected using different selection types and techniques, and directly manipulated by the user. main character behavior. π
Three different formats or views are supported by the Container. They are specified via the XmNentryViewType resource:
XmLARGE_ICONXmSMALL_ICONXmANY_ICON
Three different layout types are supported by the Container. They are specified by the XmNlayoutType resource:
XmSPATIALXmOUTLINEXmDETAIL
In the XmSPATIAL layout type, several other resources (XmNspatialStyle, XmNspatialIncludeModel, XmNspatialSnapModel) control the positioning of the items within the Container; an application programmer can specify these resources so that the Container strictly enforces the position of each item or so that the Container positions items according to constraint resources specified for each item. The user, however, can alter the position of an item in the XmSPATIAL layout type within the Container by direct manipulation; for example, by pressing BTransfer over the item and then dragging and releasing BTransfer over some location within the Container. iconic drag energy. β¨
In the XmOUTLINE layout type, the Container controls the positioning of the items. Items within the Container can have parent-child relationships between them. Each item's XmNentryParent resource can specify another item in the same Container as its parent; items with a non-NULL value for XmNentryParent can only be displayed in the XmOUTLINE layout type. In the XmOUTLINE layout type, items are positioned in a tree configuration with connecting lines drawn to illustrate the relationships. Items are positioned top to bottom in the order specified by XmNpositionIndex within their parent. Container positions a PushButton next to each item that has a parent relationship to other items. The PushButton contains a pixmap to illustrate whether the child items are shown or not; the user can activate the PushButton to toggle between showing or hiding the child items. Direct manipulation to alter the position of the item is not supported in the XmOUTLINE layout type. Note that the XmNtraversalOn resource of the PushButtons created by Container are set to False. no touchy. π
The XmDETAIL layout type is the same as XmOUTLINE, except that each item can also display additional information as rows in columns with column headers specified in the XmNdetailColumnHeading resources. In each item row, the item's detail information (see the reference page on XmIconGadget for a description of the XmNentryDetail resource) is displayed. Items are positioned top to bottom in the order specified by XmNpositionIndex within the parent. details on details. π
π Selection π
When a child widget of the container is selected, the container specifies that the item should display the appropriate visual information to the user via the ContainerItem trait. The application program is notified of selection changes through XmNselectionCallback. callback cutie. π
The container uses four selection policies:
- Single
- Browse
- Multiple
- Extended
In Single Select and Browse Select modes, only one item can be selected at a time. Pressing BSelect on an item selects it and deselects any other selected item. Pressing BSelect over an empty space in the Container deselects all items. In Browse Select, dragging BSelect moves the selection as the pointer is moved. one at a time, bestie. π
In Multiple Select and Extended Select modes, any number of items can be selected at the same time. In Multiple Select, pressing and dragging BSelect or BExtend to specify an item, range of items, or group of discontiguous items causes the selection states of those items to be toggled. In Extended Select, pressing and dragging BSelect to indicate an item, range of items, or group of discontiguous items selects those items and deselects all others. Pressing and dragging BExtend in Extended Select to indicate an item, range of items, or discontiguous group of items causes the selection states of those items to be toggled. multi-select main character energy. β¨
Several techniques are available to indicate an item, range of items, or group of discontiguous items in the Multiple Select and Extended Select modes.
In the XmSPATIAL and XmOUTLINE layout types, the XmNselectionTechnique resource specifies the techniques to be used to indicate items. The default specification of XmTOUCH_OVER allows both the Random-Swipe and Marquee techniques to be used when XmNlayoutStyle is XmSPATIAL. The default specification of XmTOUCH_OVER allows the Range-Swipe, Range-Click, and Marquee techniques to be used when XmNlayoutStyle is XmOUTLINE. defaults ate. π₯
Discontiguous groups of items can be selected using the Random-Swipe technique. In the Random-Swipe technique, pressing BSelect (or BExtend) over an item and dragging BSelect over other items selects all of those items. Only those items that pointer passed over are selected.
In the Range-Swipe technique, the user presses BSelect (or BExtend) over the first item and releases BSelect over the last item; all items within the range between the first and last item are selected whether the pointer actually passed over them or not. In the Range-Click technique, the user presses and releases BSelect (or BExtend) over the first item and then presses and releases BExtend over the last item. range game strong. π
In the Marquee technique, pressing BSelect (or BExtend) over a blank space within the Container indicates the starting point of a Marquee rectangle. Dragging BSelect draws a Marquee rectangle (rubberband line) between the starting point and current pointer. All items completely within the Marquee rectangle are selected. rubberband line, literally. π
Specifying XmTOUCH_ONLY for XmNselectionTechnique enforces the Random-Swipe technique even when BSelect (or BExtend) is pressed over a blank space. Similarly, specifying XmMARQUEE enforces the Marquee technique even when BSelect (or BExtend) is pressed over an item; since the item over which the press occurs is only partially included in the Marquee rectangle, it is not selected. XmMARQUEE_EXTEND_START and XmMARQUEE_EXTEND_BOTH enforce the Marquee technique and also cause the rectangle to extend automatically around the first item indicated and, for XmMARQUEE_EXTEND_BOTH, the last item. marquee rules, no cap. π
In the XmDETAIL layout type, the Range-Swipe and Range-Click techniques are available to indicate a range of items for selection.
Container uses the XmQTcontainerItem, XmQTscrollFrame, and XmQTspecifyRenderTable traits and holds the XmQTcontainer and XmQTtransfer traits. trait queen. π
π¦ Data Transfer Behavior π¦
Container supports dragging of selected items from the widget. Depending on the value of XmNprimaryOwnership, Container can also support primary selection. drag and drop, but make it fashion. π
As a source of data, Container supports the following targets and associated conversions of data to these targets:
localeβ If the locale target matches the widget's locale, the widget transfers the selected items in the encoding of the locale. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item.COMPOUND_TEXTβ The widget transfers the selected items as typeCOMPOUND_TEXT. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item.DELETEβ The widget deletes the selected items.PIXMAPβ The widget transfers a list of the pixmap IDs of the selected items as typeDRAWABLE.STRINGβ The widget transfers the selected items as typeSTRING. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item.TEXTβ If the selected items are fully convertible to the encoding of the locale, the widget transfers the selected items in the encoding of the locale. Otherwise, the widget transfers the selected items as typeCOMPOUND_TEXT. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item._MOTIF_CLIPBOARD_TARGETSβ The widget transfers, as typeATOM, a list of the targets it supports for immediate transfer for theCLIPBOARDselection. These include_MOTIF_COMPOUND_STRINGandPIXMAP. If the selected items are fully convertible toSTRING, these also includeSTRING; otherwise, they also includeCOMPOUND_TEXTandUTF8_STRING._MOTIF_COMPOUND_STRINGβ The widget transfers the selected items as a compound string in Byte Stream format. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item.UTF8_STRINGβ The widget transfers the selected items as typeUTF8_STRING. The value for each item transferred, except the last, includes a trailing separator. Each item value is theXmNlabelStringof the item._MOTIF_DEFERRED_CLIPBOARD_TARGETSβ The widget transfers, as typeATOM, a list of the targets it supports for delayed transfer for theCLIPBOARDselection. This widget currently supplies no targets for_MOTIF_DEFERRED_CLIPBOARD_TARGETS._MOTIF_DRAG_OFFSETβ The widget transfers a list of two 16-bit numbers, of typeINTEGER, representing an x and y offset for an item being dragged. This offset is calculated so that, if the offset were added to the x and y coordinates at the drop site, and the dragged pixmap placed at that position, it would correspond to the position the user would expect the pixmap to placed at, based on the drag icon used at the drop site._MOTIF_EXPORT_TARGETSβ The widget transfers, as typeATOM, a list of the targets to be used as the value of theDragContext'sXmNexportTargetsin a drag-and-drop transfer. These include_MOTIF_COMPOUND_STRING,PIXMAP,COMPOUND_TEXT, the encoding of the locale,STRING,TEXT,BACKGROUND,FOREGROUND, andUTF8_STRING.
As a source of data, Container also supports the following standard Motif targets:
BACKGROUNDβ The widget transfersXmNbackgroundas typePIXEL.CLASSβ the widget hunts down the first shell in the widget hierarchy that's got aWM_CLASSproperty, and hands the contents over as text in the current locale. πCLIENT_WINDOWβ the widget finds that same first shell in the hierarchy and transfers its window as typeWINDOW.COLORMAPβ the widget transfersXmNcolormapas typeCOLORMAP. slay.FOREGROUNDβ the widget transfersXmNforegroundas typePIXEL.NAMEβ same detective work asCLASS, bestie: it finds the first shell in the widget hierarchy that has aWM_NAMEproperty and transfers the contents as text in the current locale.TARGETSβ the widget transfers a list of the targets it supports, as typeATOM. That list includes the standard targets in this very list β¨ <span>and</span> it also includes_MOTIF_COMPOUND_STRING,PIXMAP,COMPOUND_TEXT, the encoding of the locale,STRING,TEXT, andUTF8_STRING.TIMESTAMPβ the widget transfers the timestamp used to acquire the selection as typeINTEGER._MOTIF_RENDER_TABLEβ the widget transfersXmNrenderTableif it exists, or else the default text render table, as typeSTRING._MOTIF_ENCODING_REGISTRYβ the widget transfers its encoding registry as typeSTRING. The value is a list of NULL separated items in the form of tag encoding pairs. This target symbolizes the transfer target for the Motif Segment Encoding Registry. Widgets and applications can use this Registry to register text encoding formats for specified render table tags. Applications access this Registry by callingXmRegisterSegmentEncodingandXmMapSegmentEncoding.
Okay so as a destination for data? Container is lowkey picky π it supports only the dropping of items being dragged from the same widget. Subclasses and the XmNdestinationCallback procedures are the ones responsible for any other data transfers to the widget. no cap.
𧬠Classes π§¬
Container inherits behavior, resources, and traits from the Core, Composite, Constraint, and XmManager classes. iconic lineage fr fr π
- The class pointer is
xmContainerWidgetClass. - The class name is
XmContainer.
β¨ 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 whether 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).
bestie write this down:C= creation time,S=XtSetValues,G=XtGetValues,N/A= not applicable. that's the whole vibe check for the access column π
so here's the tea on the XmContainer resource set, bestie β every single knob you can turn, listed out with its class, type, default and access mode. Memorise these, they're your whole personality now. β¨
For each one: the Name is what you pass in, the Class is what resource files and XtSetArg fallbacks see, the Type is what it actually is, the Default is what you get when you say nothing (which is a choice too, no judgement), and Access tells you when you're allowed to touch it β CSG means set at creation, set later, or get; C means creation time only, so set it in your arg list or don't set it at all π
.
XmNautomaticSelectionβ classXmCAutomaticSelection, typeunsigned char, defaultXmAUTO_SELECT, accessCSG. The vibe of how selection behaves automatically. π¦XmNcollapsedStatePixmapβ classXmCCollapsedStatePixmap, typePixmap, defaultdynamic, accessCSG. The lil picture for a collapsed outline entry. πXmNconvertCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. Creation-time-only callback list for conversion stuff. βXmNdefaultActionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. What fires when someone double-clicks a thing with main character energy. π₯XmNdestinationCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. The destination side of a drag, and again:Cmeans creation only, so don't come at it later. πXmNdetailColumnHeadingβ classXmCDetailColumnHeading, typeXmStringTable, defaultNULL, accessCSG. The heading strings for your detail columns. β¨XmNdetailColumnHeadingCountβ classXmCDetailColumnHeadingCount, typeCardinal, default0, accessCSG. How many headings you just handed over. Count them, queen. π’XmNdetailOrderβ classXmCDetailOrder, typeCardinal *, defaultNULL, accessCSG. A pointer to the order the detail columns get laid out in. π§XmNdetailOrderCountβ classXmCDetailOrderCount, typeCardinal, defaultdynamic, accessCSG. How many entries are in that order array. β¨XmNdetailTabListβ classXmCDetailTabList, typeXmTabList, defaultNULL, accessCSG. Tab stops for the detail view, so your columns don't look unhinged. πXmNentryViewTypeβ classXmCEntryViewType, typeunsigned char, defaultXmANY_ICON, accessCSG. What kind of view the entries get. πXmNexpandedStatePixmapβ classXmCExpandedStatePixmap, typePixmap, defaultdynamic, accessCSG. The glow-up version of the collapsed pixmap: shown when an outline entry is open. πΈXmNfontListβ classXmCFontList, typeXmFontList, defaultNULL, accessCSG. Your fonts. Aesthetics are not optional. πXmNlargeCellHeightβ classXmCCellHeight, typeDimension, defaultdynamic, accessCSG. The tall-girl cell height. πXmNlargeCellWidthβ classXmCCellWidth, typeDimension, defaultdynamic, accessCSG. The wide-girl cell width. πXmNlayoutTypeβ classXmCLayoutType, typeunsigned char, defaultXmSPATIAL, accessCSG. How the container arranges its children. π¦XmNmarginHeightβ classXmCMarginHeight, typeDimension, default0, accessCSG. Breathing room top and bottom. πXmNmarginWidthβ classXmCMarginWidth, typeDimension, default0, accessCSG. Breathing room left and right. β¨XmNoutlineButtonPolicyβ classXmCOutlineButtonPolicy, typeunsigned char, defaultXmOUTLINE_BUTTON_PRESENT, accessCSG. Whether those lil outline buttons show up at all. πXmNoutlineChangedCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. Fires when the outline changes β and yes,C, creation time only, I said what I said. π₯XmNoutlineColumnWidthβ classXmCOutlineColumnWidth, typeDimension, defaultdynamic, accessCSG. How wide the outline column gets. βXmNoutlineIndentationβ classXmCOutlineIndentation, typeDimension, default40, accessCSG. How far each nesting level gets pushed in. Forty. Not a typo, that's the default. π§XmNoutlineLineStyleβ classXmCLineStyle, typeunsigned char, defaultXmSINGLE, accessCSG. The line style connecting your outline tree. π
ngl bestie, notice how the callback ones are allCand everything else isCSG. That's not a coincidence, that's a rule β callbacks get wired up at creation or they get nothing. π«Ά
and we're not done yet, there's more coming so don't go anywhere π
Okay bestie, here's the rest of that resource table, no skips, no crumbs left behind. Every row, every column, exactly as it was:
XmNprimaryOwnershipβ classXmCprimaryOwnership, typeunsigned char, defaultXmOWN_POSSIBLE_MULTIPLE, accessCSGXmNrenderTableβ classXmCRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNselectColorβ classXmCSelectColor, typePixel, defaultdynamic, accessCSGXmNselectedObjectsβ classXmCSelectedObjects, typeWidgetList, defaultNULL, accessSGXmNselectedObjectCountβ classXmCSelectedObjectCount, typeunsigned int, default0, accessSGXmNselectionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNselectionPolicyβ classXmCSelectionPolicy, typeunsigned char, defaultXmEXTENDED_SELECT, accessCSGXmNselectionTechniqueβ classXmCSelectionTechnique, typeunsigned char, defaultXmTOUCH_OVER, accessCSGXmNsmallCellHeightβ classXmCCellHeight, typeDimension, defaultdynamic, accessCSGXmNsmallCellWidthβ classXmCCellWidth, typeDimension, defaultdynamic, accessCSGXmNspatialIncludeModelβ classXmCSpatialIncludeModel, typeunsigned char, defaultXmAPPEND, accessCSGXmNspatialResizeModelβ classXmCSpatialResizeModel, typeunsigned char, defaultXmGROW_MINOR, accessCSGXmNspatialSnapModelβ classXmCSpatialSnapModel, typeunsigned char, defaultXmNONE, accessCSGXmNspatialStyleβ classXmCSpatialStyle, typeunsigned char, defaultXmGRID, accessCSG
And now the part you actually came for: the resource deep dives. Grab a snack, this is the good stuff. π
β¨ XmNautomaticSelection
The vibe check on when selection callbacks actually fire. Does the Container invoke selection callbacks the instant each item gets selected (or toggled), or does it stay quiet until the user has wrapped up their selection actions β like, say, released the mouse button? It takes one of these two values:
XmAUTO_SELECTβ fires selection callbacks automatically the moment each item is selected or toggled. This can also be the valueTRUE.XmNO_AUTO_SELECTβ delays selection callbacks until the user has finished their selection actions. This can also be the valueFALSE.
β¨ XmNcollapsedStatePixmap
Which lil' picture shows up when a branch is closed. This specifies the pixmap to display on a PushButton sitting next to a Container item that has child items, and it only matters when XmNoutlineButtonPolicy is XmOUTLINE_BUTTON_PRESENT. XmNcollapsedStatePixmap is basically the icon saying "hey, the child items are not displayed right now." If you set it to XmUNSPECIFIED_PIXMAP, a default pixmap showing an arrow pointing up gets used instead. π¦
β¨ XmNconvertCallback
For when somebody asks the Container to hand over a selection. This specifies a list of callbacks called when the Container is asked to convert a selection. The type of the structure whose address gets passed to these callbacks is XmConvertCallbackStruct. The reason is XmCR_OK.
β¨ XmNdefaultActionCallback
The double-click moment. Iconic. This specifies a list of callbacks to call when the user double-clicks an item, or presses <Enter> or <Return> while over an item. The callback structure is XmContainerSelectCallbackStruct. The reason is XmCR_DEFAULT_ACTION.
β¨ XmNdestinationCallback
Container as the receiving end of a transfer, periodt. This specifies a list of callbacks called when the Container is the destination of a transfer operation. The type of the structure whose address is passed to these callbacks is XmDestinationCallbackStruct. The reason is XmCR_OK.
β¨ XmNdetailColumnHeading
Column labels for the detail layout, bestie. This specifies a table of XmStrings to display as the headings to columns. If it's NULL, or if XmNlayoutType is not XmDETAIL, then no heading gets displayed at all. π
β¨ XmNdetailColumnHeadingCount
Just the headcount for the heading table. This specifies a count of XmStrings in the table specified for XmNdetailColumnHeading.
β¨ XmNdetailOrder
Which column goes where, and in what order. This specifies an array of Cardinals that indicate which column detail information, and in which order, each Container child will display its detail information. Heads up: this resource is ignored if XmNlayoutType is not XmDETAIL. If it's NULL, the default behavior is determined by XmNdetailOrderCount.
β¨ XmNdetailOrderCount
How many entries are in that order array. This specifies a count of Cardinals in the array specified for XmNdetailOrder. If XmNdetailOrder is NULL and XmNdetailOrderCount is not 0, then each Container child displays its detail information in order from column 1 to the XmNdetailOrderCount column number. If XmNdetailOrderCount is 0, then a default gets calculated from the detail order count information of each item accessed via the ContainerItem trait.
β¨ XmNdetailTabList
Where each column starts in the detail layout. This indicates an XmTabList specifying the start of each column in the XmDETAIL layout. If this resource is set to NULL, then Container calculates an XmTabList for you. This resource is ignored if XmNlayoutType is not XmDETAIL. π
β¨ XmNentryViewType
One view type to rule all the Container children. This specifies the view type for all Container children. The view type is specified for each item via the ContainerItem trait. It takes one of these values:
XmANY_ICONβ no specification is made for Container children. Children just use their own default specifications.XmLARGE_ICONβ the view type for all children isXmLARGE_ICON.XmSMALL_ICONβ the view type for all children isXmSMALL_ICON.XmNexpandedStatePixmapβ the pixmap that shows up on a PushButton sitting next to a Container item that has child items, but only whenXmNoutlineButtonPolicyisXmOUTLINE_BUTTON_PRESENT. It's basically saying "hey bestie, the children are out and visible rn." If you set it toXmUNSPECIFIED_PIXMAP, you get a default pixmap of an arrow pointing down. β¨XmNfontListβ the fontlist tied toXmContainer. Okay so real talk, the fontlist is an obsolete construct and has been superseded by the render table. It's only still here for compatibility with earlier versions of Motif and for apps that don't easily support render tables. The default fontlist is derived from the default render table, and if you specify both a fontlist and a render table, the render table takes precedence. πXmNlargeCellHeightβ the height of a cell forXmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmLARGE_ICONorXmANY_ICON.XmNlargeCellWidthβ the width of a cell forXmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmLARGE_ICONorXmANY_ICON.XmNlayoutTypeβ the policy for laying out child widgets inside the Container. It can be one of these values:XmDETAILβ displays items the same way as when the resource isXmOUTLINE, except every item also shows detail information next to it.XmOUTLINEβ displays items in a tree configuration, inXmNpositionIndexwithinXmNentryParentorder, with connecting lines drawn to show their parent-child relationships. π³XmSPATIALβ displays items according toXmNspatialStyle. Items withXmNentryParentvalues are not displayed.
XmNmarginHeightβ the margin spacing at the top and bottom of the Container.XmNmarginWidthβ the margin spacing at the left and right sides of the Container.XmNoutlineButtonPolicyβ says whether or not to show buttons so users can expand and collapse the display of items. It can be one of these values:XmOUTLINE_BUTTON_ABSENTβ do not display the outline buttons.XmOUTLINE_BUTTON_PRESENTβ display the outline buttons.
XmNoutlineChangedCallbackβ a list of callbacks to call when an item'sXmNoutlineStatechanges. The callback structure isXmContainerOutlineCallbackStruct. The reason isXmCR_COLLAPSEDorXmCR_EXPANDED, depending on the new value ofXmNoutlineState.XmNoutlineColumnWidthβ the width of the first column displayed whenXmNlayoutTypeisXmDETAIL. And whenXmNlayoutTypeisXmOUTLINE, it's the preferred width of the Container (without the margins). If you don't specify it, Container will determine a default value equal to the widest space necessary to display an item's pixmap andXmNoutlineIndentation. πXmNoutlineIndentationβ the distance to indent for the display of child items whenXmNlayoutTypeisXmOUTLINEorXmDETAIL.XmNoutlineLineStyleβ says whether to draw lines between items that have parent-child relationships whenXmNlayoutTypeisXmOUTLINEorXmDETAIL. It can be one of these values:XmNO_LINEβ draws no line.XmSINGLEβ draws a line one pixel wide.
XmNprimaryOwnershipβ says whether Container takes ownership of the primary selection when a selection is made inside it. This resource can take these values:XmOWN_NEVERβ never takes ownership.XmOWN_ALWAYSβ always takes ownership.XmOWN_MULTIPLEβ only takes ownership if more than one element has been selected.XmOWN_POSSIBLE_MULTIPLEβ only takes ownership if more than one element can be selected at a time.
XmNrenderTableβ theXmRenderTablethat gets inherited by all children of the Container. The default is implementation dependent. If both a render table and a fontlist are specified, the render table will take precedence. πXmNselectColorβ aPixelthat can be accessed by children of the Container and used to indicate that the child is in a selected state. Along with aPixelvalue, you can also specify these symbolic values:XmDEFAULT_SELECT_COLORβ a color between the background and the bottom shadow color.XmREVERSED_GROUND_COLORSβ forces the select color to the foreground color and causes the default color of any text rendered over the select color to be the background color.HIGHLIGHT_COLORβ forces the fill color to use the highlight color.
XmNselectedObjectCountβ the number of widgets in the selected items list. The value must be the number of items inXmNselectedObjects.XmNselectedObjectsβ an array of widgets that represents the Container items currently selected, either by the user or by the application.
If the application sets XmNselectedObjects to an array of widgets, those array elements that are valid Container items are selected.
XmNselectionCallbackβ a list of callbacks to call when an item is selected. The callback structure isXmContainerSelectCallbackStruct. The reason isXmCR_SINGLE_SELECT,XmCR_BROWSE_SELECT,XmCR_MULTIPLE_SELECT, orXmCR_EXTENDED_MULTIPLE, depending onXmNselectionPolicy.XmNselectionPolicyβ defines how the selection action gets interpreted. This can be one of these values:XmSINGLE_SELECTβ allows only single selections.XmBROWSE_SELECTβ allows "drag and browse" selections.XmMULTIPLE_SELECTβ allows multiple selections.XmEXTENDED_SELECTβ allows extended selections.
XmNselectionTechniqueβ the selection technique to use when the Container displays items in a 2-dimensional layout (XmNentryViewTypeisXmLARGE_ICONorXmSMALL_ICON). In theXmDETAILlayout, theXmNselectionTechniqueresource is treated asXmTOUCH_ONLY. Either way, it can be one of these values:XmMARQUEEβ uses the Marquee technique only.XmMARQUEE_EXTEND_STARTβ uses the Marquee technique only and extends the Marquee rectangle around any item under the Marquee start point.XmMARQUEE_EXTEND_BOTHβ uses the Marquee technique only and extends the Marquee rectangle around any items under the Marquee start and end points.XmTOUCH_ONLYβ uses the Random-Swipe technique only ifXmNlayoutTypeisXmSPATIAL. Otherwise, uses the Range-Swipe and Range-Click techniques.XmTOUCH_OVERβ if the selection action begins over an item andXmNlayoutTypeisXmSPATIAL, uses the Random-Swipe technique. If the selection action begins over an item andXmNlayoutTypeisXmOUTLINEorXmDETAIL, uses the Range-Swipe and Range-Click techniques. Uses the Marquee technique if the select action begins over an unoccupied area in the Container.
XmNsmallCellHeightβ the height of a cell forXmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmSMALL_ICON.XmNsmallCellWidthβ the width of a cell forXmGRIDorXmCELLSspatial style whenXmNentryViewTypeisXmSMALL_ICON.XmNspatialIncludeModelβ the layout of an item when the item is managed in the Container whenXmNlayoutTypeisXmSPATIALandXmNspatialStyleisXmGRIDorXmCELLS. It can be one of these values:XmAPPENDβ places the item after the last occupied cell according toXmNlayoutDirection.XmCLOSESTβ places the item in the free cell closest to the position specified byXmNxandXmNy.XmFIRST_FITβ places the item in the first free cell according toXmNlayoutDirection.
XmNspatialResizeModelβ how Container will attempt to grow its dimensions whenXmNlayoutTypeisXmSPATIALandXmNspatialStyleisXmGRIDorXmCELLSand there aren't enough cells to contain a new Container item. It can be one of these values:XmGROW_BALANCEDβ Container will request both width and height growth from its parent.XmGROW_MAJORβ Container will request growth in its major dimension from its parent. Container's major dimension is width when the precedence ofXmNlayoutDirectionis horizontal, and height when vertical.XmGROW_MINORβ Container will request growth in its minor dimension from its parent. Container's minor dimension is height when the precedence ofXmNlayoutDirectionis horizontal, and width when vertical.
XmNspatialSnapModelβ how Container will position an item within the cell layout whenXmNlayoutTypeisXmSPATIALandXmNspatialStyleisXmGRIDorXmCELLS. It can be one of these values:XmCENTERβ center the items as follows, depending on the value ofXmNentryViewType:
XmLARGE_ICONβ bestie the child is centered in the cell horizontally and baseline-aligned vertically β¨XmSMALL_ICONβ the child is centered in the cell vertically on its baseline, and lined up with the left or right of the cell horizontally, depending on whateverXmNlayoutDirectionis giving πXmSNAP_TO_GRIDβ drops the item at the upper-left or upper-right corner of the cell(s), depending on the value ofXmNlayoutDirection. it's giving "snap into place" fr fr πXmNONEβ positions the item according to the position specified byXmNxandXmNy. and if that position isn't within the coordinates of the cell(s)? then it positions the item at the upper-left or upper-right corner of the cell(s), depending on the value ofXmNlayoutDirection. lowkey a little chaotic but okay π
XmNspatialStyle
Specifies the layout of Container items when XmNlayoutType is XmSPATIAL. It can have one of the following values:
XmCELLSβ lays out items within a grid of same-size cells. each item occupies as many cells as required to contain the item dimensions. no cap, it takes up the space it needs πXmGRIDβ lays out items within a grid of same-size cells, but each item occupies only one cell. items that are larger than the cell size may overlap other items π (yes bestie, the overlap is real, that's literally what it says)XmNONEβ lays out items according toXmNxandXmNy. that's it, that's the vibe.
β¨ XmContainer Constraint Resource Set β¨
okay so here's the whole resource set, laid out (pun intended π«Ά) β same info, just cuter:
XmNentryParentβ Class:XmCWidget, Type:Widget, Default:NULL, Access:CSGXmNoutlineStateβ Class:XmCOutlineState, Type:unsigned char, Default:XmCOLLAPSED, Access:CSGXmNpositionIndexβ Class:XmCPositionIndex, Type:int, Default:dynamic, Access:CSG
XmNentryParent
Specifies the widget that is this item's logical parent. A value of NULL means "this is a root-level item," aka main character energy with no parent π.
Parent-child info is displayed only when the XmNlayoutPolicy is XmOUTLINE or XmDETAIL. otherwise bestie, it's just not showing up, periodt.
XmNoutlineState
Specifies whether to display child items when XmNlayoutPolicy is XmOUTLINE or XmDETAIL. It can have one of the following values:
XmCOLLAPSEDβ does not display child items. keeping it hidden, keeping it mysterious πXmEXPANDEDβ displays child items. the children have entered the chat πΈ
XmNpositionIndex
Specifies the order of items in the Container for display. When XmNlayoutType is XmOUTLINE or XmDETAIL, items are displayed in XmNpositionIndex order within XmNentryParent.
Items that have an XmNentryParent resource are ignored when XmNlayoutType is XmSPATIAL. like, ignored ignored π
If XmNpositionIndex is not specified, it defaults to the XmNpositionIndex value plus 1 of the item with the highest XmNpositionIndex that has the same XmNentryParent, if such an item exists; otherwise, it defaults to 0. okay so it just queues itself up right after the last one, or starts at zero if there's nobody there yet. so organized, we love a self-sorting icon β¨
π Inherited Resources π
Container inherits behavior and resources from the superclasses described in the following tables. For a complete description of each resource, refer to the reference page for that superclass. yes bestie, you gotta go read the superclass pages too β the lore is deep π¦
okay so the XmManager Resource Set? it's giving organized, it's giving everything. the columns are Name, Class, Type, Default, and Access. and bestie, we are doing <em>all</em> of them. no skips. π
XmNbottomShadowColorβ Class:XmCBottomShadowColorβ’ Type:Pixelβ’ Default:dynamicβ’ Access:CSGXmNbottomShadowPixmapβ Class:XmCBottomShadowPixmapβ’ Type:Pixmapβ’ Default:XmUNSPECIFIED_PIXMAPβ’ Access:CSGXmNforegroundβ Class:XmCForegroundβ’ Type:Pixelβ’ Default:dynamicβ’ Access:CSGXmNhelpCallbackβ Class:XmCCallbackβ’ Type:XtCallbackListβ’ Default:NULLβ’ Access:CXmNhighlightColorβ Class:XmCHighlightColorβ’ Type:Pixelβ’ Default:dynamicβ’ Access:CSGXmNhighlightPixmapβ Class:XmCHighlightPixmapβ’ Type:Pixmapβ’ Default:dynamicβ’ Access:CSGXmNinitialFocusβ Class:XmCInitialFocusβ’ Type:Widgetβ’ Default:NULLβ’ Access:CSGXmNlayoutDirectionβ Class:XmCLayoutDirectionβ’ Type:XmDirectionβ’ Default:dynamicβ’ Access:CGXmNnavigationTypeβ Class:XmCNavigationTypeβ’ Type:XmNavigationTypeβ’ Default:XmTAB_GROUPβ’ Access:CSGXmNpopupHandlerCallbackβ Class:XmCCallbackβ’ Type:XtCallbackListβ’ Default:NULLβ’ Access:CXmNshadowThicknessβ Class:XmCShadowThicknessβ’ Type:Dimensionβ’ Default:0β’ Access:CSGXmNstringDirectionβ Class:XmCStringDirectionβ’ Type:XmStringDirectionβ’ Default:dynamicβ’ Access:CGXmNtopShadowColorβ Class:XmCTopShadowColorβ’ Type:Pixelβ’ Default:dynamicβ’ Access:CSGXmNtopShadowPixmapβ Class:XmCTopShadowPixmapβ’ Type:Pixmapβ’ Default:dynamicβ’ Access:CSGXmNtraversalOnβ Class:XmCTraversalOnβ’ Type:Booleanβ’ Default:Trueβ’ Access:CSGXmNunitTypeβ Class:XmCUnitTypeβ’ Type:unsigned charβ’ Default:dynamicβ’ Access:CSGXmNuserDataβ Class:XmCUserDataβ’ Type:XtPointerβ’ Default:NULLβ’ Access:CSG
and that's the whole set, no cap. every single resource accounted for, exactly as the original table says. πβ¨
β¨ Composite Resource Set β¨
okay bestie, this is the lil family of resources that every composite widget rolls with π here's the whole lineup, no gatekeeping:
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessG. it's giving "here's the whole friend group" π«ΆXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSGXmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG. literally just "how many besties are in the group chat" π
π Core Resource Set π
and THIS one?? the whole entire core set, every last one, presented with zero skips because we don't do that here β¨:
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
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββΌβββββββββββββββββΌβββββββββββββββββββββββΌβββββββββ€
βββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ΄βββββββββββββββββ΄βββββββββββββββββββββββ΄βββββββββ
π Callback Information π
Okay bestie, this is the part where you find out exactly what shows up in your callback when the Container pings you. A pointer to this lil struct gets passed to callbacks for XmNoutlineChangedCallback:
typedef struct
{
int reason;
XEvent * event;
Widget item;
unsigned char new_outline_state;
} XmContainerOutlineCallbackStruct;
reasonβ tells you why the callback got called, periodt.eventβ points at theXEventthat triggered the callback. Ngl, it can beNULL.itemβ the container item that got affected by the event. πnew_outline_stateβ the nextXmNoutlineStateforitem. And here's the cute part: you, the user, can actually change this value inside the callback. slay.
A pointer to this next structure is what gets passed to callbacks for XmNdefaultActionCallback and XmNselectionCallback:
typedef struct
{
int reason;
XEvent * event;
WidgetList selected_items;
int selected_item_count;
unsigned char auto_selection_type;
} XmContainerSelectCallbackStruct;
reasonβ specifies the reason for the callback. It corresponds to theXmNselectionPolicyat the time the selection was made, or it indicates that the default action should be taken.eventβ points to theXEventthat triggered the callback. It can beNULL. (yes, again, we love a nullable pointer π )selected_itemsβ a list of items selected at the time of the event that caused the callback. π¨ IMPORTANT bestie: this field points to temporary storage space that gets reused after the callback finishes. So if your app needs to keep that list, you must copy it into your own data space. Do not hold onto it. Not even for a sec.selected_item_countβ how many items are in theselected_itemslist. This number has to be positive or0(zero).auto_selection_typeβ tells you the cause of the selection whenXmNautomaticSelectionisXmAUTO_SELECT. The valid values are, and I need you to focus:XmAUTO_UNSETβ returned whenXmNautomaticSelectionisXmNO_AUTO_SELECT.XmAUTO_BEGINβ indicates the beginning of automatic selection.XmAUTO_MOTIONβ indicates that there is a button drag selection.XmAUTO_CANCELβ indicates that the new selection is canceled.XmAUTO_NO_CHANGEβ indicates that the currently selected item matches the initial item.XmAUTO_CHANGEβ indicates that the currently selected item does not match the initial item.
Next up: a pointer to this structure is passed to the XmNconvertCallback procedures. π¦
typedef struct
{
int reason;
XEvent *event;
Atom selection;
Atom target;
XtPointer source_data;
XtPointer location_data;
int flags;
XtPointer parm;
int parm_format;
unsigned long parm_length;
int status;
XtPointer value;
Atom type;
int format;
unsigned long length;
} XmConvertCallbackStruct;
reasonβ indicates why the callback was invoked.eventβ points to theXEventthat triggered the callback. It can beNULL.selectionβ indicates the selection for which conversion is being requested. Possible values areCLIPBOARD,PRIMARY,SECONDARY, and_MOTIF_DROP.targetβ indicates the conversion target.source_dataβ contains info about the selection source. When the selection is_MOTIF_DROP,source_datais theDragContext. Otherwise, it'sNULL.location_dataβ contains info about the location of data to be converted. If the value isNULL, the data being transferred is the widget's current selection. Otherwise, it's the widget ID of the item being transferred, or the widget ID of the Container if all items are being transferred.flagsβ indicates the status of the conversion. Here are the possible values:XmCONVERTING_NONEβ this flag is currently unused. πXmCONVERTING_PARTIALβ the target widget was able to be converted, but some data was lost. πXmCONVERTING_SAMEβ the conversion target is the source of the data to be transferred.XmCONVERTING_TRANSACTβ this flag is currently unused. (unused flag count: 2, iconic behaviour honestly)
parmβ contains parameter data for this target. If there's no parameter data, the value isNULL.
When selection is CLIPBOARD and target is _MOTIF_CLIPBOARD_TARGETS or _MOTIF_DEFERRED_CLIPBOARD_TARGETS, the value is the requested operation (XmCOPY, XmMOVE, or XmLINK).
parm_formatβ specifies whether the data inparmshould be viewed as a list ofchar,short, orlongquantities. Possible values are0(whenparmisNULL),8(when the data inparmshould be viewed as a list ofchars),16(when the data inparmshould be viewed as a list ofshorts), or32(when the data inparmshould be viewed as a list oflongs).
β οΈ Okay this one trips people up so listen:parm_formatsymbolizes a data type, not the number of bits in each list element. For example, on some machines, aparm_formatof32means that the data inparmshould be viewed as a list of 64-bit quantities, not 32-bit quantities. ikykyk. π€―
parm_lengthβ the number of elements of data inparm, where each element has the size specified byparm_format. WhenparmisNULL, the value is0.statusβ an IN/OUT member that specifies the status of the conversion. Its initial value isXmCONVERT_DEFAULT. The callback procedure can set this member to one of the following values:XmCONVERT_DEFAULTβ the widget class conversion procedure, if any, is called after the callback procedures return. If the widget class conversion procedure produces any data, it overwrites the data provided by the callback procedures in thevaluemember.XmCONVERT_MERGEβ the widget class conversion procedure, if any, is called after the callback procedures return. If the widget class conversion procedure produces any data, it appends its data to the data provided by the callback procedures in thevaluemember. This value is intended for use with targets that result in lists of data, such asTARGETS.XmCONVERT_DONEβ the callback procedure has successfully finished the conversion. The widget class conversion procedure, if any, is not called after the callback procedures return.XmCONVERT_REFUSEβ the callback procedure has terminated the conversion process without completing the requested conversion. The widget class conversion procedure, if any, is not called after the callback procedures return.
valueβ an IN/OUT parameter that contains any data the callback procedure produces as a result of the conversion. Its initial value isNULL. If the callback procedure sets this member, it must make sure thetype,format, andlengthmembers correspond to the data invalue. And heads up: the callback procedure is responsible for allocating β but not for freeing β memory when it sets this member.typeβ an IN/OUT parameter that indicates the type of the data in thevaluemember. Its initial value isINTEGER.formatβ an IN/OUT parameter that specifies whether the data invalueshould be viewed as a list ofchar,short, orlongquantities. Its initial value is8. The callback procedure can set this member to8(for a list ofchar),16(for a list ofshort), or32(for a list oflong).lengthβ an IN/OUT member that specifies the number of elements of data invalue, where each element has the size symbolized byformat. Its initial value is0(zero).
A pointer to the following callback structure is passed to the XmNdestinationCallback procedures:
typedef struct
{
int reason;
XEvent *event;
Atom selection;
XtEnum operation;
int flags;
XtPointer transfer_id;
XtPointer destination_data;
XtPointer location_data;
Time time;
} XmDestinationCallbackStruct;
reasonβ indicates why the callback was invoked.eventβ points to theXEventthat triggered the callback. It can beNULL.selectionβ indicates the selection for which data transfer is being requested. Possible values areCLIPBOARD,PRIMARY,SECONDARY, and_MOTIF_DROP.operationβ indicates the type of transfer operation requested. π- When the
selectionisPRIMARY, possible values areXmMOVE,XmCOPY, andXmLINK. - When the
selectionisSECONDARYorCLIPBOARD, possible values areXmCOPYandXmLINK. - When the
selectionis_MOTIF_DROP, possible values areXmMOVE,XmCOPY,XmLINK, andXmOTHER. A value ofXmOTHERmeans that the callback procedure must get further information from theXmDropProcCallbackStructin thedestination_datamember.
- When the
flagsβ tells you whether the destination widget is also the source of the data being transferred. (Iconic little identity-crisis moment, we love it π .) Possible values:XmCONVERTING_NONEβ nope, the destination widget is not the source of the data being transferred.XmCONVERTING_SAMEβ yep bestie, the destination widget is the source of the data being transferred.
transfer_idβ serves as a unique ID that identifies the transfer transaction. Think of it as the transaction's little receipt number π§Ύ, iykyk.destination_dataβ holds the deets about the destination. So:- When the selection is
_MOTIF_DROP, the callback procedures are called by the drop site'sXmNdropProc, anddestination_datais a pointer to theXmDropProcCallbackStructthat got passed to theXmNdropProcprocedure. - When the selection is
SECONDARY,destination_datais an Atom representing a target recommmended by the selection owner, for use in converting the selection. - Otherwise,
destination_dataisNULL.
- When the selection is
location_dataβ holds info about where the data is going to be transferred. This value is alwaysNULLwhen the selection isSECONDARYorCLIPBOARD. If the value isNULL, the data gets inserted at the widget's cursor position. Otherwise the value is a pointer to anXPointstructure holding the x and y coordinates of the spot where the data is to be transferred. π«Ά
Heads up: onceXmTransferDoneprocedures start being called,location_datawill no longer be stable. So don't be clingy with that pointer, bestie π.
timeβ indicates the time when the transfer operation began. β°
β¨ Translations β¨
The XmContainer translations are listed below.
The following key names are listed in the X standard key event translation table syntax. This format is the one Motif uses to specify the widget actions that correspond to a given key. There's a brief overview of the format over in VirtualBindings(3). For the complete description of the format, please refer to the X Toolkit Instrinsics Documentation. π
βΌc βΌs βΌm βΌa <Btn1Down>:βContainerBeginSelect()<Btn1Motion>:βContainerButtonMotion()βΌc βΌs βΌm βΌa <Btn1Up>:βContainerEndSelect()c βΌs βΌm βΌa <Btn1Down>:βContainerBeginToggle()c βΌs βΌm βΌa <Btn1Up>:βContainerEndToggle()βΌc s βΌm βΌa <Btn1Down>:βContainerBeginExtend()βΌc s βΌm βΌa <Btn1Up>:βContainerEndExtend()c s βΌm βΌa <Btn1Down>:βContainerBeginExtend()c s βΌm βΌa <Btn1Up>:βContainerEndExtend()βΌc βΌs βΌm βΌa <Btn2Down>:βContainerStartTransfer(Copy)c s βΌm βΌa <Btn2Down>:βContainerStartTransfer(Link)βΌc s βΌm βΌa <Btn2Down>:βContainerStartTransfer(Move)βΌm βΌa <Btn2Up>:βContainerEndTransfer():c s a <Key><osfInsert>:βContainerPrimaryLink():c s m <Key><osfInsert>:βContainerPrimaryLink():a <Key><osfInsert>:βContainerPrimaryCopy():m <Key><osfInsert>:βContainerPrimaryCopy():s a <Key><osfDelete>:βContainerPrimaryMove():s m <Key><osfDelete>:βContainerPrimaryMove():<Key><osfCancel>:βContainerCancel():s <Key><osfSelect>:βContainerExtend():<Key><osfSelect>:βContainerSelect():<Key><osfSelectAll>:βContainerSelectAll():<Key><osfDeselectAll>:βContainerDeselectAll():<Key><osfAddMode>:βContainerToggleMode():<Key><osfActivate>:βContainerActivate()s βΌc βΌm βΌa <Key>space:βContainerExtend()βΌs βΌc βΌm βΌa <Key>space:βContainerSelect()βΌs βΌc βΌm βΌa <Key>Return:βContainerActivate()βΌs c βΌm βΌa <Key>slash:βContainerSelectAll()βΌs c βΌm βΌa <Key>backslash:βContainerDeselectAll():c s <Key><osfBeginLine>:βContainerExtendCursor(First):c s <Key><osfEndLine>:βContainerExtendCursor(Last):c <Key><osfBeginLine>:βContainerMoveCursor(First):c <Key><osfEndLine>:βContainerMoveCursor(Last):c <Key><osfLeft>:βContainerExpandOrCollapse(Left):c <Key><osfRight>:βContainerExpandOrCollapse(Right):s <Key><osfUp>:βContainerExtendCursor(Up):s <Key><osfDown>:βContainerExtendCursor(Down):s <Key><osfLeft>:βContainerExtendCursor(Left):s <Key><osfRight>:βContainerExtendCursor(Right):<Key><osfUp>:βContainerMoveCursor(Up):<Key><osfDown>:βContainerMoveCursor(Down):<Key><osfLeft>:βContainerMoveCursor(Left):<Key><osfRight>:βContainerMoveCursor(Right)s βΌm βΌa <Key>Tab:βManagerGadgetPrevTabGroup()βΌs βΌm βΌa <Key>Tab:βManagerGadgetNextTabGroup()
The Container button event translations get modified when Display's XmNenableBtn1Transfer resource does not have a value of XmOFF β in other words, when it's either XmBUTTON2_TRANSFER or XmBUTTON2_ADJUST. This option lets the actions for selection and transfer be integrated onto <Btn1>, and the actions for extending the selection can be bound to <Btn2>. π
The actions for <Btn1> that are defined in the preceding list still apply when the <Btn1> event occurs over text that is not selected. The following actions apply when the <Btn1> event occurs over text that is selected:
~c ~s ~m ~a <Btn1Down>:βContainerHandleBtn1Down(ContainerBeginSelect,Copy)c ~s ~m ~a <Btn1Down>:βContainerHandleBtn1Down(ContainerBeginToggle,Copy)c s ~m ~a <Btn1Down>:βContainerHandleBtn1Down(ContainerNoop,Link)~c s ~m ~a <Btn1Down>:βContainerHandleBtn1Down(ContainerBeginExtend,Move)<Btn1Motion>:βContainerHandleBtn1Motion(ContainerButtonMotion)~c ~s ~m ~a <Btn1Up>:βContainerHandleBtn1Up(ContainerEndSelect)c ~s ~m ~a <Btn1Up>:βContainerHandleBtn1Up(ContainerEndToggle)~c s ~m ~a <Btn1Up>:βContainerHandleBtn1Up(ContainerEndExtend)c s ~m ~a <Btn1Down>:βContainerHandleBtn1Down(ContainerBeginExtend)c s ~m ~a <Btn1Up>:βContainerHandleBtn1Up(ContainerEndExtend)
When Display's XmNenableBtn1Transfer resource has a value of XmBUTTON2_ADJUST, the following actions apply:
~c ~s ~m ~a <Btn2Down>:βContainerHandleBtn2Down(ContainerStartTransfer,Copy)c s ~m ~a <Btn2Down>:βContainerHandleBtn2Down(ContainerStartTransfer,Link)~c s ~m ~a <Btn2Down>:βContainerHandleBtn2Down(ContainerStartTransfer,Move)<Btn2Motion>:βContainerHandleBtn2Motion(ContainerButtonMotion)~m ~a <Btn2Up>:βContainerHandleBtn2Up(ContainerEndTransfer)
π Action Routines π
The Container action routines are described below. The current selections are always shown with the background color specified by the XmNselectColor resource. π
ContainerActivate():β this action callsXmNdefaultActionCallbackwith reasonXmCR_DEFAULT_ACTION.ContainerBeginExtend():β simply returns ifXmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT. Also simply returns ifXmNlayoutTypeisXmSPATIAL.
Otherwise, this action sets the selection state of all items between the anchor item and the item under the pointer to the selection state of the anchor item. The location cursor gets moved to the item under the pointer. And if XmNautomaticSelection is XmAUTO_SELECT, the XmNselectionCallback(s) is called with either XmCR_MULTIPLE_SELECT or XmCR_EXTENDED_SELECT as the reason, depending on XmNselectionPolicy, and with auto_selection_type set to XmAUTO_CHANGE.
ContainerBeginSelect():β if this is a secondContainerBeginSelect()action that has occurred within the time specified by the display's multiclick time, this action callsXmNdefaultActionCallbackwith reasonXmCR_DEFAULT_ACTIONand returns. π±οΈ
Otherwise, the processing depends on the value of XmNselectionPolicy, like so:
XmSINGLE_SELECTβ this action deselects all items and toggles the item (if any) under the pointer.XmBROWSE_SELECTβ this action deselects all items and toggles the item (if any) under the pointer. That item is now the anchor item for further selection. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item's selection state is made, theXmNselectionCallback(s)is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_BEGIN.XmMULTIPLE_SELECTβ if the pointer is over an item andXmNselectionTechniqueis notXmMARQUEE, this action toggles the selection state of that item. The item becomes the anchor item for further selection. IfXmNselectionTechniqueisXmMARQUEE,XmMARQUEE_EXTEND_START, orXmMARQUEE_EXTEND_BOTH, this action sets the start point for the Marquee rectangle. IfXmNselectionTechniqueisXmMARQUEE_EXTEND_STARTorXmMARQUEE_EXTEND_BOTHand the pointer is over an item, this action draws the Marquee rectangle around the item. IfXmNautomaticSelectionisXmAUTO_SELECT, theXmNselectionCallback(s)is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_BEGIN.XmEXTENDED_SELECTβ all items are first deselected. Processing is then identical to the case whereXmNselectionPolicyisXmMULTIPLE_SELECT, except thatXmCR_EXTENDED_SELECTis the callback reason given ifXmNselectionCallbackis called.
ContainerBeginToggle():β simply returns ifXmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT.
Otherwise β like, if the pointer is hovering over an item and XmNselectionTechnique is not XmMARQUEE β this action toggles the selection state of that item. π That item now becomes the anchor item for whatever selection comes next. But if XmNselectionTechnique is XmMARQUEE, XmMARQUEE_EXTEND_START, or XmMARQUEE_EXTEND_BOTH, this action sets the start point for the Marquee rectangle instead. And if XmNselectionTechnique is XmMARQUEE_EXTEND_START or XmMARQUEE_EXTEND_BOTH and the pointer is over an item, this action draws the Marquee rectangle around that item. π¦ And if XmNautomaticSelection is XmAUTO_SELECT, the XmNselectionCallback(s) get called with either XmCR_MULTIPLE_SELECT or XmCR_EXTENDED_SELECT as the reason (whichever one depends on XmNselectionPolicy), and with auto_selection_type set to XmAUTO_BEGIN.
ContainerButtonMotion()β bestie, what this does is entirely down toXmNselectionPolicy. Here's the breakdown:XmSINGLE_SELECTβ this action literally just returns to the caller. That's it, that's the whole vibe. πXmBROWSE_SELECTβ it simply returns if this action follows aContainerBeginExtend()action or aContainerBeginToggle()action. But if the pointer is no longer over the current anchor item, this action toggles the current anchor item, and then toggles the item under the pointer (if there even is one) and makes it the new anchor item for further processing. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item's selection state actually got made, theXmNselectionCallback(s)is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_MOTION.XmMULTIPLE_SELECTβ if a previous action already set a Marquee rectangle start point, this action draws the Marquee rectangle between the current pointer position and the Marquee start point. IfXmNselectionTechniqueisXmMARQUEE_EXTEND_BOTHand the pointer is over an item, the end point of the Marquee rectangle gets extended to include that item. Then the selection states of all items inside the Marquee rectangle get toggled to match the state of the anchor item. β¨
If no Marquee rectangle start point is set and the pointer is over an item, what happens next depends on the XmNlayoutType resource. The anchor item from the previous action is what gets used. If XmNlayoutType is XmSPATIAL, the selection state of the item under the pointer gets toggled to match the selection state of the anchor item. If XmNlayoutType is XmOUTLINE or XmDETAIL, the selection state of all items between the anchor item and the item under the pointer get toggled to match the selection state of the anchor item.
If XmNautomaticSelection is XmAUTO_SELECT and a change in any item's selection state got made, the XmNselectionCallback(s) is called with reason XmCR_MULTIPLE_SELECT and auto_selection_type XmAUTO_MOTION.
XmEXTENDED_SELECTβ processing here is identical to theXmNselectionPolicyisXmMULTIPLE_SELECTcase, except thatXmCR_EXTENDED_SELECTis the callback reason given ifXmNselectionCallbackgets called. π
ContainerCancel()β if a selection is in progress, this action restores the selection states of all items back to whatever they were before the selection began. Time travel but make it legal. π§ IfXmNautomaticSelectionisTrueand a change in any item's selection state is made, theXmNselectionCallbackis called with reasonXmCR_BROWSE_SELECT,XmMULTIPLE_SELECT, orXmCR_EXTENDED_SELECTβ depending on theXmNselectionPolicyresource β andauto_selection_typeXmAUTO_CANCEL.ContainerDeselectAll()β deselects every single item, no survivors, and callsXmNselectionCallbackwith a reason depending onXmNselectionPolicy. πContainerEndExtend()β simply returns ifXmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT. Also simply returns ifXmNlayoutTypeisXmSPATIAL. Like, it's out, it's not doing this today.
Otherwise, if XmNautomaticSelection is XmNO_AUTO_SELECT, XmNselectionCallback(s) is called with either XmCR_MULTIPLE_SELECT or XmCR_EXTENDED_SELECT as the reason, depending on XmNselectionPolicy. If XmNautomaticSelection is XmAUTO_SELECT and no change is made in any item's selection state by this action, XmNselectionCallback(s) is called with either XmCR_MULTIPLE_SELECT or XmCR_EXTENDED_SELECT as the reason depending on XmNselectionPolicy, and auto_selection_type XmAUTO_CHANGE. And if XmNautomaticSelection is XmAUTO_SELECT and this action makes no change in any item's selection state, XmNselectionCallback(s) is called with either XmCR_MULTIPLE_SELECT or XmCR_EXTENDED_SELECT as the reason depending on XmNselectionPolicy, and auto_selection_type XmAUTO_NO_CHANGE.
ContainerEndSelect()β again, all aboutXmNselectionPolicy:XmSINGLE_SELECTβ this action callsXmNselectionCallbackwith reasonXmCR_SINGLE_SELECT. Simple, clean, iconic. β¨XmBROWSE_SELECTβ if the pointer is no longer over the current anchor item, this action toggles the current anchor item, and then toggles the item under the pointer (if any). IfXmNautomaticSelectionisXmNO_AUTO_SELECT, theXmNselectionCallback(s)is called with reasonXmCR_BROWSE_SELECT. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item's selection state is made,XmNselectionCallback(s)is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_CHANGE. And ifXmNautomaticSelectionisXmAUTO_SELECTand no change is made in any item's selection state by this action,XmNselectionCallback(s)is called with reasonXmCR_BROWSE_SELECTandauto_selection_typeXmAUTO_NO_CHANGE.XmMULTIPLE_SELECTβ this action first performs the same processing as theContainerButtonMotion()action, except thatXmNselectionCallbackdoes not get called. IfXmNautomaticSelectionisXmNO_AUTO_SELECT, theXmNselectionCallback(s)is called with reasonXmCR_MULTIPLE_SELECT. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item's selection state is made, theXmNselectionCallback(s)is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_CHANGE. And ifXmNautomaticSelectionisXmAUTO_SELECTand this action makes no change in any item's selection state,XmNselectionCallback(s)is called with reasonXmCR_MULTIPLE_SELECTandauto_selection_typeXmAUTO_NO_CHANGE.XmEXTENDED_SELECTβ this action first performs the same processing as theContainerButtonMotion()action, except thatXmNselectionCallbackis not called. IfXmNautomaticSelectionisXmNO_AUTO_SELECT, theXmNselectionCallback(s)is called with reasonXmCR_EXTENDED_SELECT. IfXmNautomaticSelectionisXmAUTO_SELECTand a change in any item's selection state is made,XmNselectionCallback(s)is called with reasonXmCR_EXTENDED_SELECTandauto_selection_typeXmAUTO_CHANGE. And ifXmNautomaticSelectionisXmAUTO_SELECTand this action makes no change in any item's selection state,XmNselectionCallback(s)is called with reasonXmCR_EXTENDED_SELECTandauto_selection_typeXmAUTO_NO_CHANGE.
ContainerEndToggle()β simply returns ifXmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT. But ifXmNselectionPolicyisXmMULTIPLE_SELECTorXmEXTENDED_SELECT, this action performs the exact same processing as theContainerEndSelect()action. Copy-paste energy, but on purpose. π«ΆContainerEndTransfer()::β if the elapsed time since aContainerStartTransfer()action happened exceeds the time span specified by the display's multiclick time, this action just returns. Otherwise, theContainerPrimaryCopy(),ContainerPrimaryLink(), orContainerPrimaryMove()action gets invoked, depending on the value of theoperationparameter thatContainerStartTransfer()saved. πContainerExpandOrCollapse(Left|Right|Collapse|Expand)β this action changes the value of theXmNoutlineStateof the current focus widget. If the argument value isCollapseorLeft, theXmNoutlineStateresource value is set toXmCOLLAPSED. If the argument value isExpandorRight, theXmNoutlineStateresource value is set toXmEXPANDED. πΈ
If the argument is Left or Right and the layout is right to left, then the setting of the XmNoutlineState value is reversed from what the preceding paragraph just said. Yes, really. π
And it simply returns if XmNlayoutType is XmSPATIAL.
ContainerExtend()β yep,XmNselectionPolicyagain, bestie:
If the selection policy is XmSINGLE_SELECT or XmBROWSE_SELECT, this action returns. If XmNlayoutType is XmSPATIAL, this action returns.
If the selection policy is XmMULTIPLE_SELECT, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item. π
so if the selection policy is XmEXTENDED_SELECT and the Container is in Normal Mode, this action deselects all items and selects all items between the anchor item and the location cursor. If the selection policy is XmEXTENDED_SELECT and the Container is in Add Mode, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item.
XmNselectionCallback is called with reason XmCR_MULTIPLE_SELECT or XmCR_EXTENDED_SELECT depending on XmNselectionPolicy.
okay bestie, here's the rest of the action lore, no cap:
ContainerExtendCursor(Left|Right|Up|Down):β Processing depends on the value ofXmNselectionPolicy, as follows:- If the selection policy is
XmSINGLE_SELECTorXmBROWSE_SELECT, this action returns. IfXmNlayoutTypeisXmSPATIAL, this action returns. - This action moves the location cursor one item in the indicated direction, if possible. If the value of the argument string is
FirstorLast, this action moves the location cursor to the indicated item. For other values of the argument string, the location cursor is not affected. - If the selection policy is
XmMULTIPLE_SELECT, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item. - If the selection policy is
XmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items and selects all items between the anchor item and the location cursor. If the selection policy isXmEXTENDED_SELECTand the Container is in Add Mode, this action sets the selection state of all items between the anchor item and the location cursor to the selection state of the anchor item. XmNselectionCallbackis called with reasonXmCR_MULTIPLE_SELECTorXmCR_EXTENDED_SELECTdepending onXmNselectionPolicy.
- If the selection policy is
ContainerHandleBtn1Down(string)β When Display'sXmNenableBtn1Transferresource is notXmOFF, the actions for selection and transfer are integrated on<Btn1>. If the pointer is over an unselected item or background, the item is first selected before the transfer is started. Otherwise, if the item is already selected, the transfer is started. The value of string can be one of the following actions:ContainerBeginSelect,CopyContainerBeginToggle,CopyContainerNoop,LinkContainerBeginExtend,Move
ContainerHandleBtn1Motion(string)β When Display'sXmNenableBtn1Transferresource is notXmOFF, the actions for selection and transfer are integrated on<Btn1>. When this action is invoked, and a selection is in progress, a drag is performed. Otherwise, the default action as specified in string is performed. The value of string can beContainerButtonMotion.ContainerHandleBtn1Up(string)β If a Button 1 transfer was in progress, then when this action is invoked, that transfer is cancelled. Otherwise, the default action as specified in string is performed. The value of string can be one of the following actions:ContainerEndSelectContainerEndToggleContainerEndExtend
ContainerHandleBtn2Down(string)β When Display'sXmNenableBtn1Transferresource has a value ofXmBUTTON2_ADJUST, the actions for extending selection are bound on<Btn2>. Otherwise, the action that is performed depends on the value of string, which can be one of the following actions:ContainerStartTransfer,CopyContainerStartTransfer,LinkContainerStartTransfer,Move
ContainerHandleBtn2Motion(string)β When Display'sXmNenableBtn1Transferresource is notXmBUTTON2_ADJUST, and a selection is in progress, a drag is performed. Otherwise, the default action that is performed depends on the value of string, which can beContainerButtonMotion.ContainerHandleBtn2Up(string)β When Display'sXmNenableBtn1Transferresource has a value ofXmBUTTON2_ADJUST, this action ends an extend. Otherwise, the action that is performed depends on the value of string, which can beContainerEndTransfer.ContainerMoveCursor(Left|Right|Up|Down|First|Last):β If the argument isLeft,Right,Up, orDown, this action moves the location cursor one item in the indicated direction, if possible. If the value of the argument string isFirstorLast, this action moves the location cursor to the indicated item. Any other arguments are ignored.- If
XmNselectionPolicyisXmBROWSE_SELECT, or ifXmNselectionPolicyisXmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items, selects the item at the location cursor, and callsXmNselectionCallbackwith the reason depending onXmNselectionPolicy.
- If
ContainerPrimaryCopy():β This action requests that primary selection data be copied to the Container. This action calls theXmNdestinationCallbackprocedures for thePRIMARYselection and theXmCOPYoperation. By default, the Container does not do any transfer, and copying the selection is the responsibility of theXmNdestinationCallbackprocedures.ContainerPrimaryLink():β This action requests that primary selection data be linked to the Container. This action calls theXmNdestinationCallbackprocedures for thePRIMARYselection and theXmLINKoperation. By default, the Container does not do any transfer, and linking the selection is the responsibility of theXmNdestinationCallbackprocedures.ContainerPrimaryMove():β This action requests that primary selection data be copied to the Container and deleted from the primary source. This action calls theXmNdestinationCallbackprocedures for thePRIMARYselection and theXmMOVEoperation. By default, the Container does not do any transfer, and moving the selection is the responsibility of theXmNdestinationCallbackprocedures. If the transfer is successful, this action then calls the selection owner'sXmNconvertCallbackprocedures for thePRIMARYselection and theDELETEtarget.ContainerSelect():β Processing depends on the value ofXmNselectionPolicy, as follows:- If the selection policy is
XmSINGLE_SELECTorXmBROWSE_SELECT, this action deselects all items and selects the item at the location cursor. - If the selection policy is
XmMULTIPLE_SELECT, this action toggles the selection state of the item at the location cursor. This item becomes the anchor item for further selections. - If the selection policy is
XmEXTENDED_SELECTand the Container is in Normal Mode, this action deselects all items and selects the item at the location cursor. If the selection policy isXmEXTENDED_SELECTand the Container is in Add Mode, this action toggles the selection state of the item at the location cursor. The selected/toggled item becomes the anchor item for further selections. XmNselectionCallbackis called with the reason depending onXmNselectionPolicy.
- If the selection policy is
ContainerSelectAll():β IfXmNselectionPolicyisXmSINGLE_SELECTorXmBROWSE_SELECT, this action deselects all items and selects the item at the location cursor position.- If
XmNselectionPolicyisXmMULTIPLE_SELECTorXmEXTENDED_SELECT, this action selects all items. XmNselectionCallbackis called with the reason depending on the value ofXmNselectionCallback.
- If
ContainerStartTransfer(Copy|Move|Link):β This action saves the event and the operation specified in the argument string for use by subsequent actions. If noContainerEndTransfer()actions occur within the time span specified by the display's multiclick time and ifXmNlayoutTypeisXmSPATIAL, this action creates aDragContextand starts a drag transfer by using string to specify the transfer operation. If no argument string is specified,Copyis the default value.- Unless default drag and drop behavior has been overridden by a
XmNconvertCallbackprocedure, if the drop operation occurs within the Container, then the item(s) being dragged are relocated at the position of the drop operation. If the item targeted by the Drag operation is not in the selected state, then only that item is moved. If the item is in the selected state, however, all items in the selected state are moved.
- Unless default drag and drop behavior has been overridden by a
ContainerToggleMode():β IfXmNselectionPolicyisXmEXTENDED_SELECT, this action toggles the Container between Normal Mode and Add Mode.
β¨ Additional Behavior β¨
The Container widget has the following additional behavior:
<Btn1Down>(2+)β If a button click is followed by another button click within the time span specified by the display's multiclick time, the Container interprets that as a double-click and calls theXmNdefaultActionCallbackcallbacks.<FocusIn>:β If the focus policy is explicit, sets the focus and draws the location cursor.<FocusOut>:β If the focus policy is explicit, removes the focus and erases the location cursor.
π¦ Virtual Bindings π¦
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3).
π RELATED π
Composite(3)Constraint(3)Core(3)XmContainerCopyXmContainerCopyLinkXmContainerCutXmContainerGetItemChildrenXmContainerPasteXmContainerPasteLinkXmContainerRelayout(3)XmContainerReorder(3)XmCreateContainer(3)XmCreateIconGadget(3)XmIconGadget(3)XmManager(3)XmVaCreateContainer(3)XmVaCreateManagedContainer(3)
Source/version: XmContainer(library call) β and the date? The original footer didn't show one, but it's giving timeless icon behavior, bestie. π
β¨
π¦ where this page comes from
- 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