XMLIST(3)
okay bestie, welcome to the XmList(library call) page π this is the manual for the List widget class, and we're gonna get you fluent in it. No cap.
π NAME π
XmList β The List widget class
β¨ SYNOPSIS β¨
#include <Xm/List.h>
πΈ DESCRIPTION πΈ
okay so List lets a user pick one or more items from a group of choices. You can select stuff with the pointer or the keyboard, so pick your vibe. List works on an array of compound strings that the application defines. Each compound string becomes an item in the List: first compound string = item in position 1, second = item in position 2, and so on. periodt.
Specifying the number of items that are visible sets the size of the List. If you don't specify the number of visible items, the height of the list controls how many are visible. Each item takes the height of the tallest element in the list. If you want a list that scrolls easily through a huge number of items, use the XmCreateScrolledList convenience function. iconic.
To select items, move the pointer or cursor to the desired item and press the <Btn1> mouse button or the key defined as <osfSelect>. There are several styles of selection behavior, and they all highlight the selected item(s) by displaying them in inverse colors. An appropriate callback gets invoked to notify the application of the user's choice, and then the app does whatever it needs for that selection. When a List is insensitive, all the list items are displayed in a stippled fill pattern. π
List uses the XmQTspecifyRenderTable, XmQTscrollFrame, and XmQTnavigator traits, and holds the XmQTtransfer trait. slay.
π Selection π
Each list has one of four selection models:
- Single Select
- Browse Select
- Multiple Select
- Extended Select
In Single Select and Browse Select, at most one item is selected at a time. In Single Select, pressing <Btn1> on an item toggles its selection state and deselects any other selected item. In Browse Select, pressing <Btn1> on an item selects it and deselects any other selected item; dragging <Btn1> moves the selection as the pointer is moved. Releasing <Btn1> on an item moves the location cursor to that item.
In Multiple Select, any number of items can be selected at a time. Pressing <Btn1> on an item toggles its selection state but does not deselect any other selected items.
In Extended Select, any number of items can be selected at a time, and the user can easily select ranges of items. Pressing <Btn1> on an item selects it and deselects any other selected item. Dragging <Btn1> or pressing or dragging <Shift><Btn1> following a <Btn1> action selects all items between the item under the pointer and the item on which <Btn1> was pressed. This action also deselects any other selected items outside that range.
Extended Select also lets the user select and deselect discontiguous ranges of items. Pressing <Ctrl><Btn1> on an item toggles its selection state but does not deselect any other selected items. Dragging <Ctrl><Btn1> or pressing or dragging <Shift><Btn1> following a <Ctrl><Btn1> action sets the selection state of all items between the item under the pointer and the item on which <Ctrl><Btn1> was pressed to the state of the item on which <Ctrl><Btn1> was pressed. This action does not deselect any other selected items outside that range.
All selection operations available from the mouse are also available from the keyboard. List has two keyboard selection modes: Normal Mode and Add Mode. In Normal Mode, navigation operations and <osfSelect> select the item at the location cursor and deselect any other selected items. In Add Mode, navigation operations have no effect on selection, and <osfSelect> toggles the selection state of the item at the location cursor without deselecting any other selected items, except in Single Select.
Single and Multiple Select use Add Mode, and Browse Select uses Normal Mode.
Extended Select can use either mode; the user changes modes by pressing <osfAddMode>. In Extended Select Normal Mode, pressing <osfSelect> has the same effect as pressing <Btn1>; <osfExtend> and shifted navigation have the same effect as pressing <Shift><Btn1> following a <Btn1> action. In Extended Select Add Mode, pressing <osfSelect> has the same effect as pressing <Ctrl><Btn1>; <osfExtend> and shifted navigation have the same effect as pressing <Shift><Btn1> following a <Ctrl><Btn1> action.
Normal Mode is indicated by a solid location cursor, and Add Mode is indicated by a dashed location cursor. π
π¦ Data Transfer Behavior π¦
List supports dragging of items from the List and transfer of items to the clipboard. When the user presses BTransfer on a selected item, the widget transfers all selected items. When the user presses BTransfer on an unselected item, the widget transfers only that item. Depending on the value of XmNprimaryOwnership, List can also support primary selection.
When the XmNconvertCallback procedures are called, the location_data member of the XmConvertCallbackStruct member is NULL if the selected items are being transferred. If the selected items are not being transferred, this member has the following value: If a single item is being transferred, the value is an integer representing the position of the item in the List. A value of 1 transfers the first item in the List; a value of 2 transfers the second item; and so on. If the entire contents of the List are being transferred, the value is -1.
As a source of data, List 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 list items in the encoding of the locale. Each item transferred except the last includes a trailing separator.COMPOUND_TEXTβ The widget transfers the selected list items as typeCOMPOUND_TEXT. Each item transferred except the last includes a trailing separator.UTF8_STRINGβ The widget transfers the selected list items as typeUTF8_STRING. Each item transferred except the last includes a trailing separator.STRINGβ The widget transfers the selected list items as typeSTRING. Each item transferred except the last includes a trailing separator.TEXTβ If the selected list items are fully convertible to the encoding of the locale, the widget transfers the selected list items in the encoding of the locale. Otherwise, the widget transfers the selected list items as typeCOMPOUND_TEXT. Each item transferred except the last includes a trailing separator._MOTIF_CLIPBOARD_TARGETSβ The widget transfers, as typeATOM, a list of the targets it supports for immediate transfer for theCLIPBOARDselection. These include_MOTIF_COMPOUND_STRING. If the selected list items are fully convertible toSTRING, these also includeSTRING; otherwise, they also includeCOMPOUND_TEXTandUTF8_STRING._MOTIF_COMPOUND_STRINGβ The widget transfers the selected list items as a compound string in Byte Stream format. Each item transferred except the last includes a trailing separator._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_EXPORT_TARGETSβ The widget transfers, as typeATOM, a list of the targets to be used as the value of the DragContext'sXmNexportTargetsin a drag-and-drop transfer. These include_MOTIF_COMPOUND_STRING,COMPOUND_TEXT,UTF8_STRING, the encoding of the locale,STRING,TEXT,BACKGROUND, andFOREGROUND._MOTIF_LOSE_SELECTIONβ When the widget loses the selection, it deselects all list items.
As a source of data, List also supports the following standard Motif targets:
BACKGROUNDβ The widget transfersXmNbackgroundas typePIXEL.CLASSβ The widget finds the first shell in the widget hierarchy that has aWM_CLASSproperty and transfers the contents as text in the current locale.CLIENT_WINDOWβ The widget finds the first shell in the widget hierarchy and transfers its window as typeWINDOW.COLORMAPβ The widget transfersXmNcolormapas typeCOLORMAP.FOREGROUNDβ The widget transfersXmNforegroundas typePIXEL.NAMEβ The widget 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, as typeATOM, a list of the targets it supports. These include the standard targets in this list. These also include_MOTIF_COMPOUND_STRING,COMPOUND_TEXT,UTF8_STRINGthe encoding of the locale,STRING, andTEXT.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 ofNULLseparated 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.
List has no widget class destination procedure. Subclasses and the XmNdestinationCallback procedures are responsible for any data transfers to the widget. no cap.
π Classes π
List inherits behavior, resources, and traits from Core and XmPrimitive.
The class pointer is xmListWidgetClass.
The class name is XmList.
β¨ New Resources β¨
okay bestie, this is the part where we meet the resources π β the table below defines a whole set of widget resources that you, the programmer, use to specify data. it's giving "choose your own adventure" but make it X11 π
and here's the cute part: you can also set the resource values on the inherited classes, and that way you're setting attributes for this widget too. slay, inheritance ate fr fr π§¬β¨
πΈ how to talk about them in your .Xdefaults πΈ
so if you wanna reference a resource by name or by class inside a .Xdefaults file, here's the move:
- π drop the
XmNorXmCprefix - π keep the remaining letters, that's your reference
and if you wanna specify one of the defined values for a resource in that same .Xdefaults file?
- π¦ drop the
Xmprefix - π¦ use the remaining letters β in either lowercase or uppercase, dealer's choice, no cap β but keep any underscores that live between the words. don't you dare ghost the underscores π
π the access column (iykyk)
the codes in the access column are basically the vibe check for each resource, telling you what you're allowed to do with it:
Cβ you can set it at creation time πΌSβ you can set it usingXtSetValuesβοΈGβ you can retrieve it usingXtGetValuesπN/Aβ not applicable, it's just not that girl π
periodt. now go forth and read that table like the main character you are πβ
okay bestie the resource set is giving β¨full course mealβ¨ so let's go item by item, every single one, no skips π
XmNautomaticSelectionβ classXmCAutomaticSelection, typeXtEnum, defaultFalse, accessCSGXmNbrowseSelectionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNdefaultActionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNdestinationCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNdoubleClickIntervalβ classXmCDoubleClickInterval, typeint, defaultdynamic, accessCSGXmNextendedSelectionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNfontListβ classXmCFontList, typeXmFontList, defaultdynamic, accessCSGXmNitemCountβ classXmCItemCount, typeint, default0, accessCSGXmNitemsβ classXmCItems, typeXmStringTable, defaultNULL, accessCSGXmNlistMarginHeightβ classXmCListMarginHeight, typeDimension, default0, accessCSGXmNlistMarginWidthβ classXmCListMarginWidth, typeDimension, default0, accessCSGXmNlistSizePolicyβ classXmCListSizePolicy, typeunsigned char, defaultXmVARIABLE, accessCGXmNlistSpacingβ classXmCListSpacing, typeDimension, default0, accessCSGXmNmatchBehaviorβ classXmCMatchBehavior, typeunsigned char, defaultXmQUICK_NAVIGATE, accessCSGXmNmultipleSelectionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNprimaryOwnershipβ classXmCPrimaryOwnership, typeunsigned char, defaultXmOWN_NEVER, accessCSGXmNrenderTableβ classXmCRenderTable, typeXmRenderTable, defaultdynamic, accessCSGXmNscrollBarDisplayPolicyβ classXmCScrollBarDisplayPolicy, typeunsigned char, defaultXmAS_NEEDED, accessCSGXmNselectColorβ classXmCSelectColor, typeXmRSelectColor, defaultXmREVERSED_GROUND_COLORS, accessCSGXmNselectedItemCountβ classXmCSelectedItemCount, typeint, default0, accessCSGXmNselectedItemsβ classXmCSelectedItems, typeXmStringTable, defaultNULL, accessCSGXmNselectedPositionCountβ classXmCSelectedPositionCount, typeint, default0, accessCSGXmNselectedPositionsβ classXmCSelectedPositions, typeunsigned int *, defaultNULL, accessCSG
fr fr keep scrolling, the list is longer than my skincare routine π«Ά
XmNselectionModeβ classXmCSelectionMode, typeunsigned char, default dynamic, accessCSGπXmNselectionPolicyβ classXmCSelectionPolicy, typeunsigned char, defaultXmBROWSE_SELECT, accessCSGπXmNsingleSelectionCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, default dynamic, accessCSGπXmNtopItemPositionβ classXmCTopItemPosition, typeint, default1, accessCSGπXmNvisibleItemCountβ classXmCVisibleItemCount, typeint, default dynamic, accessCSGπ
XmNautomaticSelection β okay so this one is a whole vibe. It invokes either XmNbrowseSelectionCallback or XmNextendedSelectionCallback when <Btn1> is pressed, and the items that show up as selected change β but ONLY if the value is True (or XmAUTO) and the selection mode is XmBROWSE_SELECT or XmEXTENDED_SELECT respectively. If it's False (XmNO_AUTO_SELECT), no selection callbacks fire at all until the user actually lets go of the mouse button. Wanna know how this resource plays with the selection modes? Go read Behavior, bestie, the details live there. π«Ά
XmNbrowseSelectionCallback β a list of callbacks that gets called when an item is selected in the browse selection mode. The reason is XmCR_BROWSE_SELECT. β¨
XmNdefaultActionCallback β a list of callbacks that gets called when an item is double clicked, or when <osfActivate> is pressed. The reason is XmCR_DEFAULT_ACTION. π₯
XmNdestinationCallback β a list of callbacks called when the List is the destination of a transfer operation. The type of the structure whose address gets passed to these callbacks is XmDestinationCallbackStruct. The reason is XmCR_OK. π
XmNdoubleClickInterval β if one button click is followed by another button click inside the time span this resource specifies (in milliseconds), the two clicks count as a double-click action instead of two separate single-click actions. The value must not be negative. The default value is the display's multiclick time. β±οΈ
XmNextendedSelectionCallback β a list of callbacks that gets called when items are selected using the extended selection mode. The reason is XmCR_EXTENDED_SELECT. π
XmNfontList β the font list associated with the list items. Heads up though: XmNfontList is obsolete and exists only for compatibility with previous releases. You should now use XmNrenderTable instead of XmNfontList. If you specify both, the render table takes precedence. The font list gets used together with the XmNvisibleItemCount resource to figure out the height of the List widget. If this value is NULL at initialization, the parent hierarchy of the widget gets searched for a widget holding the XmQTspecifyRenderTable trait. If such an ancestor is found, the font list is initialized to the XmTEXT_RENDER_TABLE value of that ancestor widget. If no such widget is found, the default is implementation dependent. For more on a font list structure, go check XmFontList(3). π
XmNitemCount β the total number of items. The value must be the number of items in XmNitems and must not be negative. It's automatically updated by the list whenever an item is added to or deleted from the list. π’
XmNitems β points to an array of compound strings that are to be displayed as the list items. For more on the creation and structure of compound strings, see XmString(3). Careful bestie: XtGetValues for this resource returns the list items themselves, not a copy of them. The application must not free the returned items. π¨
XmNlistMarginHeight β the height of the margin between the list border and the items. π
XmNlistMarginWidth β the width of the margin between the list border and the items. π
XmNlistSizePolicy β controls how the List reacts when an item grows horizontally beyond the current size of the list work area.
- If the value is
XmCONSTANT, the list viewing area does not grow, and a horizontalScrollBargets added for a List whose parent is aScrolledWindow. - If this resource is set to
XmVARIABLE, the List grows to match the size of the longest item, and no horizontalScrollBarappears. - When the value is
XmRESIZE_IF_POSSIBLE, the List attempts to grow or shrink to match the width of the widest item. If it can't grow to match the widest size, a horizontalScrollBargets added for a List whose parent is aScrolledWindowif the longest item is wider than the list viewing area.
The size policy must be set at the time the List widget is created. It cannot be changed later through XtSetValues. Periodt. π
XmNlistSpacing β the spacing between list items. This spacing increases by the value of the XmNhighlightThickness resource in Primitive. π
XmNmatchBehavior β the matching behavior that XmList follows. The current values are XmNONE and XmQUICK_NAVIGATE, like this:
XmNONEβ means the typed-in characters are ignored. πXmQUICK_NAVIGATEβ means 1-character navigation shall be supported when List has focus. If the typed character is the initial character of some set of items in List, the first of those items following the current item will be navigated to (it becomes the current item). If all such items precede the current item, the first such item becomes the current item. After that, typing the same character again cyclically navigates among the items with the same first character. π
XmNmultipleSelectionCallback β a list of callbacks that gets called when an item is selected in multiple selection mode. The reason is XmCR_MULTIPLE_SELECT. πΈ
XmNprimaryOwnership β specifies whether XmContainer takes ownership of the Primary selection when a selection is made inside it. This resource can take the following 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 β the render table associated with the list items. The render table is used together with the XmNvisibleItemCount resource to determine the height of the List widget. If this value is NULL at initialization, List searches its parent hierarchy for a widget holding the XmQTspecifyRenderTable trait. If such an ancestor is found, the render table is initialized to the XmTEXT_RENDER_TABLE value of that ancestor widget. If no such widget is found, the default is implementation dependent. If a font list and a render table are both specified, the render table takes precedence. For more on the creation and structure of a render table, go see XmRenderTable(3). π¦
XmNscrollBarDisplayPolicyβ this one's the boss of the vertical ScrollBars in a List whose parent is a ScrolledWindow. β¨ When it's set toXmAS_NEEDED, a vertical ScrollBar only shows up when the number of items in the List is bigger than the number of visible items (so likeβ¦ only when there's actually stuff hiding π). When it'sXmSTATIC, that vertical ScrollBar is always there, no matter what. Periodt.XmNselectColorβ lets the application pick the color of the background rectangle that shows off which text is selected. It takes two values:XmDEFAULT_SELECT_COLORβ makes the select color land somewhere between the background color and the bottom shadow color. Cute little in-between moment. πXmREVERSED_GROUND_COLORSβ forces the select color to be the foreground color, and forces the color of any text drawn on top of the select color to be the background color. Full swap energy. πHIGHLIGHT_COLORβ forces the fill color to use the highlight color. That's it, that's the whole vibe. π
XmNselectedItemCountβ says how many strings live in the selected items list. The value has to be the number of items inXmNselectedItems, and bestie it must not be negative. πXmNselectedItemsβ points to an array of compound strings representing the list items that are currently selected, whether the user did it or the application did it.XtGetValueson this resource hands you back the list items themselves, not a copy of them β so the application must not free the returned items or the array. Do not touch, do not free, we don't do that here. π
Setting XmNselectedItems selects those list items that exactly match items in the given XmNselectedItems list. There may be extra items sitting in XmNselectedItems that don't match anything in the list β and those just chill there until XmNselectedItems gets updated. And if XmNitems changes so the list now contains items matching those previously unmatched entries in XmNselectedItems, those new items will show up selected too. Surprise selection, love that for them. π¦
Any user interaction with the list that causes at least one item to be selected or deselected, plus any call to XmListDeleteAllItems, XmListDeleteItem, XmListDeleteItems, XmListDeleteItemsPos, XmListDeletePos, XmListDeletePositions, XmListDeselectAllItems, XmListDeselectItem, XmListDeselectPos, XmListSelectItem, XmListSelectPos, or XmListUpdateSelectedList, causes XmNselectedItems to be updated immediately so it exactly reflects the visual state of the list. Calls to any other XmList functions do not affect XmNselectedItems. That's the whole list, no extras, no cap. π₯
XmNselectedPositionCountβ says how many positions are in the selected positions list. The value must be the number of items inXmNselectedPositions. (Yes, the original sentence just ends right there, we're not adding punctuation to the source material, we're just respecting the bit. β¨)XmNselectedPositionsβ points to an array of the positions of the selected items in the List.XtGetValueson this resource returns the list items themselves, not a copy of the list items. The application must not free the returned items or the array. Same rule as before, bestie β hands off. πXmNselectionModeβ defines what effect keyboard navigations have on selection. The valid modes are:XmADD_MODEβ allows no navigation operations to have any effect on selection, and<osfSelect>toggles the selection state of the item at the location cursor without deselecting any other selected items, except in Single Select. But the widget cannot be put into add mode if theXmNselectionPolicyresource is an incompatible mode (XmNselectionPolicycannot beXmBROWSE_SELECT). So check your policy first, okay? πXmNORMAL_MODEβ allows navigation operations and<osfSelect>to select the item at the location cursor and deselect any other selected items. But the widget cannot be put into normal mode if theXmNselectionPolicyresource is an incompatible mode (XmNselectionPolicycannot beXmSINGLE_SELECTorXmMULTIPLE_SELECT). Same energy, different vibes. π
XmNselectionPolicyβ defines the interpretation of the selection action. This can be one of the following:XmSINGLE_SELECTβ allows only single selections. One and done. πXmMULTIPLE_SELECTβ allows multiple selections. Collect them all. πΈXmEXTENDED_SELECTβ allows extended selections. Go long, go wide. πXmBROWSE_SELECTβ allows drag-and-browse functionality. Scroll and snoop. π¦
XmNsingleSelectionCallbackβ specifies a list of callbacks that gets called when an item is selected in single selection mode. The reason isXmCR_SINGLE_SELECT. β¨XmNstringDirectionβ a synthetic resource for settingXmNlayoutDirection. The values for this resource areXmSTRING_DIRECTION_L_TO_RandXmSTRING_DIRECTION_R_TO_L. Peep theXmNlayoutDirectionresource description for the full story. Lowkey important:XmNstringDirectionis obsoleted byXmNlayoutDirection, but it's kept here for backward compatibility. Elder resource, still in the group chat. π«ΆXmNtopItemPositionβ specifies the position of the item that is the first visible item in the list. Setting this resource is equivalent to calling theXmListSetPosfunction. The position of the first item in the list is1; the position of the second item is2; and so on. A position of0(zero) specifies the last item in the list. The value must not be negative. Counting starts at one, bestie, don't @ me. πXmNvisibleItemCountβ specifies the number of items that can fit in the visible space of the list work area. The List uses this value to determine its height. The value must be greater than0(zero). Zero is not it. π₯
Inherited Resources
List 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. π
π The XmPrimitive Resource Set π
okay bestie, deep breath, because here comes the entire XmPrimitive resource lineup π
every widget in the XmPrimitive family rocks this exact set, and I am not skipping a single one β we are doing all of them, no cap. β¨
For each one you're getting the resource name, its class, its type, its default, and its access code. That's the whole vibe. Periodt. π«Ά
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, default isdynamic, accessCSG. πXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, default isXmUNSPECIFIED_PIXMAP, accessCSG. πXmNconvertCallbackβ classXmCCallback, typeXtCallbackList, default isNULL, accessC. β¨XmNforegroundβ classXmCForeground, typePixel, default isdynamic, accessCSG. πΈXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, default isNULL, accessC. π¦XmNhighlightColorβ classXmCHighlightColor, typePixel, default isdynamic, accessCSG. πXmNhighlightOnEnterβ classXmCHighlightOnEnter, typeBoolean, default isFalse, accessCSG. πXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, default isdynamic, accessCSG. βXmNhighlightThicknessβ classXmCHighlightThickness, typeDimension, default is2, accessCSG. πXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, default isdynamic, accessCG. πXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, default isXmTAB_GROUP, accessCSG. π₯XmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, default isNULL, accessC. πXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default is2, accessCSG. πXmNtopShadowColorβ classXmCTopShadowColor, typePixel, default isdynamic, accessCSG. πXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, default isdynamic, accessCSG. π§XmNtraversalOnβ classXmCTraversalOn, typeBoolean, default isTrue, accessCSG. β¨XmNunitTypeβ classXmCUnitType, typeunsigned char, default isdynamic, accessCSG. πΈXmNuserDataβ classXmCUserData, typeXtPointer, default isNULL, accessCSG. π
and yes, that's literally every single one β I counted twice, you're welcome. π
heads up bestie: watch the access codes, they're not all the same!CGandCSGare not interchangeable, and the ones markedCare a whole different lane. π
π Core Resource Set π
okay bestie, this is the whole core resource lineup, fr fr. every single one, no skipping, we're eating today π
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 β¨
List defines a brand new callback structure, bestie, it's giving β¨new eraβ¨. the way this works is: your app has to look at the reason field first, and only touch the struct members that are actually valid for that particular reason β because not every field is relevant for every possible reason, and reaching for the wrong one is not the vibe π. the callback structure is defined like this:
typedef struct
{
int reason;
XEvent *event;
XmString item;
int item_length;
int item_position;
XmString *selected_items;
int selected_item_count;
int *selected_item_positions;
char selection_type;
unsigned char auto_selection_type;
} XmListCallbackStruct;
reasonβ spills the tea on why the callback was invoked πeventβ points at theXEventthat triggered the callback. it can beNULL, so like... check it, bestie.itemβ the last item that got selected at the time of the event that caused the callback. heads up tho:itempoints to a temporary storage space that gets reused the second the callback is done. so if your app needs to keep the item around, it has to copy it into its own data space. no cap, it will not wait for you πitem_lengthβ the length in bytes ofitem. this member is obsolete and only exists for compatibility with earlier releases (it's giving legacy, we still love her π )
okay so, picking up right where we left off:
item_positionβ the position (plus one) of item in the List'sXmNitemsarray. Anitem_positionvalue of one means it's the first element in the list. periodt. πselected_itemsβ a list of items that were selected at the time of the event that caused the callback. It points to temporary storage that gets reused after the callback is finished. So if your app needs to save that selected list, copy it into its own data space, bestie. no cap. π«Άselected_item_countβ the number of items in theselected_itemslist. This number must be non-negative.selected_item_positionsβ an array of integers, one for each selected item, showing the position of each selected item in the List'sXmNitemsarray. It points to temporary storage that gets reused after the callback is finished. So if your app needs to save this array, copy it into its own data space. πselection_typeβ tells you that the most recent extended selection was the initial selection (XmINITIAL), a modification of an existing selection (XmMODIFICATION), or an additional noncontiguous selection (XmADDITION).auto_selection_typeβ indicates the type of automatic selection callback. The types include:XmAUTO_BEGINβ the beginning of automatic selection.XmAUTO_MOTIONβ there's a button drag selection.XmAUTO_CANCELβ the new selection is cancelled.XmAUTO_NO_CHANGEβ the currently selected item matches the initial item.XmAUTO_CHANGEβ the currently selected item does not match the initial item.
The following table describes the reasons for which the individual callback structure fields are valid. Here's the breakdown, no cap:
XmCR_SINGLE_SELECTβ valid fields:reason,event,item,item_length,item_positionXmCR_DEFAULT_ACTIONβ valid fields:reason,event,item,item_length,item_position,selected_items,selected_item_count,selected_item_positionsXmCR_BROWSE_SELECTβ valid fields:reason,event,item,item_length,item_positionXmCR_MULTIPLE_SELECTβ valid fields:reason,event,item,item_length,item_position,selected_items,selected_item_count,selected_item_positionsXmCR_EXTENDED_SELECTβ valid fields:reason,event,item,item_length,item_position,selected_items,selected_item_count,selected_item_positions,selection_type
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 selection is
PRIMARY, possible values areXmMOVE,XmCOPY, andXmLINK. - When the selection is
SECONDARYorCLIPBOARD, possible values areXmCOPYandXmLINK. - When the selection is
_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 selection is
flagsβ indicates whether or not the destination widget is also the source of the data to be transferred. Following are the possible values:XmCONVERTING_NONEβ the destination widget is not the source of the data to be transferred.XmCONVERTING_SAMEβ the destination widget is the source of the data to be transferred.
transfer_idβ serves as a unique ID to identify the transfer transaction.destination_dataβ contains information about the destination. When the selection is_MOTIF_DROP, the callback procedures are called by the drop site'sXmNdropProc, anddestination_datais a pointer to theXmDropProcCallbackStructpassed to theXmNdropProcprocedure. When the selection isSECONDARY,destination_datais anAtomrepresenting a target recommended by the selection owner for use in converting the selection. Otherwise,destination_dataisNULL.location_dataβ contains information about the location where data is to be transferred. The value is alwaysNULLwhen the selection isSECONDARYorCLIPBOARD. If the value isNULL, the data is to be inserted at the widget's cursor position. Otherwise, the value is an integer representing the position in the List where the items are to be transferred. A value of1makes the first new item the first item in the list; a value of2makes it the second item; and so on. OnceXmTransferDoneprocedures start to be called,location_datawill no longer be stable.timeβ indicates the time when the transfer operation began.
β¨ Translations β¨
XmList includes translations from Primitive. The XmList translations are described in the following list.
The following key names are listed in the X standard key event translation table syntax. This format is the one used by Motif to specify the widget actions corresponding to a given key. A brief overview of the format is provided under VirtualBindings(3). For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation.
<Btn1><Motion>:βListButtonMotion()π¦s βΌm βΌa <Btn1Down>:βListBeginExtend()s βΌm βΌa <Btn1Up>:βListEndExtend()c βΌs βΌm βΌa <Btn1Down>:βListBeginToggle()c βΌs βΌm βΌa <Btn1Up>:βListEndToggle()βΌs βΌc βΌm βΌa <Btn1Down>:βListBeginSelect()βΌs βΌc βΌm βΌa <Btn1Up>:βListEndSelect()<Btn2Down>:βListProcessDrag()πΈ:s c <Key><osfBeginLine>:βListBeginDataExtend():c <Key><osfBeginLine>:βListBeginData():<Key><osfBeginLine>:βListBeginLine():s c <Key><osfEndLine>:βListEndDataExtend():c <Key><osfEndLine>:βListEndData():<Key><osfEndLine>:βListEndLine():<Key><osfPageLeft>:βListLeftPage():c <Key><osfPageUp>:βListLeftPage():<Key><osfPageUp>:βListPrevPage():<Key><osfPageRight>:βListRightPage():c <Key><osfPageDown>:βListRightPage():<Key><osfPageDown>:βListNextPage()π«s <KeyDown><osfSelect>:βListKbdBeginExtend():<KeyDown><osfSelect>:βListKbdBeginSelect():s <KeyUp><osfSelect>:βListKbdEndExtend():<KeyUp><osfSelect>:βListKbdEndSelect():<Key><osfSelectAll>:βListKbdSelectAll():<Key><osfDeselectAll>:βListKbdDeSelectAll():<Key><osfActivate>:βListKbdActivate():<Key><osfAddMode>:βListAddMode():<Key><osfHelp>:βPrimitiveHelp()π:<Key><osfCancel>:βListKbdCancel():c <Key><osfLeft>:βListLeftPage():<Key><osfLeft>:βListLeftChar():c <Key><osfRight>:βListRightPage():<Key><osfRight>:βListRightChar():s <Key><osfUp>:βListExtendPrevItem():<Key><osfUp>:βListPrevItem():s <Key><osfDown>:βListExtendNextItem():<Key><osfDown>:βListNextItem()π₯:c <Key><osfInsert>:βListCopyToClipboard():<Key><osfCopy>:βListCopyToClipboard()β¨βΌs c βΌm βΌa <Key>slashβListKbdSelectAll()βΌs c βΌm βΌa <Key>backslashβListKbdDeSelectAll()s βΌm βΌa <Key>TabβPrimitivePrevTabGroup()βΌm βΌa <Key>TabβPrimitiveNextTabGroup()βΌs βΌm βΌa <Key>ReturnβListKbdActivate()βΌs βΌm βΌa <KeyDown>spaceβListKbdBeginSelect()βΌs βΌm βΌa <KeyUp>spaceβListKbdEndSelect()s βΌm βΌa <KeyDown>spaceβListKbdBeginExtend()s βΌm βΌa <KeyUp>spaceβListKbdEndExtend()<Key>βListQuickNavigate()
okay so plot twist: all of those List button event translations get modified when Display's XmNenableBtn1Transfer resource does not have a value of XmOFF β like, in other words, when it's either XmBUTTON2_TRANSFER or XmBUTTON2_ADJUST. π«Ά This option lets the actions for selection and transfer get integrated onto <Btn1>, and lets the extending-the-selection actions get bound to <Btn2>. The <Btn1> actions defined up above still apply whenever the <Btn1> event happens over text that is not selected. But the following actions kick in when the <Btn1> event happens over text that is selected:
<Btn1Motion>βListProcessBtn1(ListButtonMotion)s βΌm βΌa <Btn1Down>βListProcessBtn1(ListBeginExtend)s βΌm βΌa <Btn1Up>βListProcessBtn1(ListEndExtend)c βΌs βΌm βΌa <Btn1Down>βListProcessBtn1(ListBeginToggle)c βΌs βΌm βΌa <Btn1Up>βListProcessBtn1(ListEndToggle)βΌs βΌc βΌm βΌa <Btn1Down>βListProcessBtn1(ListBeginSelect)βΌs βΌc βΌm βΌa <Btn1Up>βListProcessBtn1(ListEndSelect)
And when Display's XmNenableBtn1Transfer resource has a value of XmBUTTON2_ADJUST, these actions apply:
<Btn2Down>βListProcessBtn2(ListBeginExtend)<Btn2Motion>βListProcessBtn2(ListButtonMotion)<Btn2Up>βListProcessBtn2(ListEndExtend)
π¬ Action Routines π¬
The XmList action routines are all described in the list below. Heads up bestie: the current selection is always shown with inverted colors. π
ListAddMode()β Toggles the state of Add Mode for keyboard selection.ListBeginData()β Moves the location cursor to the first item in the list. In Normal Mode, this also deselects any current selection, selects the first item in the list, and calls the appropriate selection callbacks (XmNbrowseSelectionCallbackwhenXmNselectionPolicyis set toXmBROWSE_SELECT,XmNextendedSelectionCallbackwhenXmNselectionPolicyis set toXmEXTENDED_SELECT).ListBeginDataExtend()β- If
XmNselectionPolicyis set toXmMULTIPLE_SELECTorXmEXTENDED_SELECT, this action moves the location cursor to the first item in the list. - If
XmNselectionPolicyis set toXmEXTENDED_SELECT, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; changes the selection state of the first item and all items between it and the current anchor point to the state of the item at the current anchor point; calls theXmNextendedSelectionCallbackcallbacks.
- If
ListBeginExtend()β IfXmNselectionPolicyis set toXmEXTENDED_SELECT, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done, and changes the selection state of the item under the pointer and all items between it and the current anchor point to the state of the item at the current anchor point. IfXmNautomaticSelectionis set toTrue, this action calls theXmNextendedSelectionCallbackcallbacks. Theauto_selection_typecomponent of the callback structure will be set toXmAUTO_BEGIN.ListBeginLine()β Moves the horizontal scroll region to the beginning of the line.ListBeginSelect()β literally four different vibes depending on your policy:- If
XmNselectionPolicyis set toXmSINGLE_SELECT, deselects any current selection and toggles the selection state of the item under the pointer. - If
XmNselectionPolicyis set toXmBROWSE_SELECT, deselects any current selection and selects the item under the pointer. IfXmNautomaticSelectionis set toTrue, calls theXmNbrowseSelectionCallbackcallbacks. Theauto_selection_typecomponent of the callback structure will be set toXmAUTO_BEGIN. - If
XmNselectionPolicyis set toXmMULTIPLE_SELECT, toggles the selection state of the item under the pointer. Any previous selections remain. - If
XmNselectionPolicyis set toXmEXTENDED_SELECT, this action deselects any current selection, selects the item under the pointer, and sets the current anchor at that item. IfXmNautomaticSelectionis set toTrue, this action calls theXmNextendedSelectionCallbackcallbacks. Theauto_selection_typecomponent of the callback structure will be set toXmAUTO_BEGIN.
- If
ListBeginToggle()β IfXmNselectionPolicyis set toXmEXTENDED_SELECT, this action moves the current anchor to the item under the pointer without changing the current selection. If the item is unselected, this action selects it; if the item is selected, this action unselects it. IfXmNautomaticSelectionis set toTrue, this action calls theXmNextendedSelectionCallbackcallbacks.
Otherwise, the list takes keyboard focus. No other action occurs. The auto_selection_type component of the callback structure will be set to XmAUTO_BEGIN.
ListButtonMotion()β- If
XmNselectionPolicyis set toXmBROWSE_SELECT, this action deselects any current selection and selects the item under the pointer. IfXmNautomaticSelectionis set toTrueand the pointer has entered a new list item, this action calls theXmNbrowseSelectionCallbackcallbacks. - If
XmNselectionPolicyis set toXmEXTENDED_SELECT, this action does the following: If an extended selection is being made and an extended selection has previously been made from the current anchor point, restores the selection state of the items in that range to their state before the previous extended selection was done and changes the selection state of the item under the pointer and all items between it and the current anchor point to the state of the item at the current anchor point. IfXmNautomaticSelectionis set toTrueand the pointer has entered a new list item, calls theXmNextendedSelectionCallbackcallbacks. - If the pointer leaves a scrolled list, this action scrolls the list in the direction of the pointer motion. The
auto_selection_typecomponent of the callback structure will be set toXmAUTO_MOTION.
- If
ListCopyToClipboard()β Copies the content of the selected items to the clipboard as a single compound string with each item separated by a newline. This action calls theXmNconvertCallbackprocedures, possibly multiple times, for theCLIPBOARDselection. πListEndData()β Moves the location cursor to the last item in the list. In Normal Mode, this also deselects any current selection, selects the last item in the list, and calls the appropriate selection callbacks (XmNbrowseSelectionCallbackwhenXmNselectionPolicyis set toXmBROWSE_SELECT,XmNextendedSelectionCallbackwhenXmNselectionPolicyis set toXmEXTENDED_SELECT).ListEndDataExtend()β- If
XmNselectionPolicyis set toXmMULTIPLE_SELECTorXmEXTENDED_SELECT, this action moves the location cursor to the last item in the list. - If
XmNselectionPolicyis set toXmEXTENDED_SELECT, this action does the following: If an extended selection has been made from the current anchor point, restores the selection state of the items in that range to their state before the extended selection was done; changes the selection state of the last item and all items between it and the current anchor point to the state of the item at the current anchor point; calls theXmNextendedSelectionCallbackcallbacks.
- If
ListEndExtend()β IfXmNselectionPolicyis set toXmEXTENDED_SELECT, this action moves the location cursor to the last item selected or deselected and calls theXmNextendedSelectionCallbackcallbacks.
If XmNautomaticSelection is set to True, then the auto_selection_type field of the callback will be valid. If XmNselectionPolicy is set to XmBROWSE_SELECT and the currently selected item position matches the position of the item that was selected before the browse selection began, or if XmNselectionPolicy is set to XmEXTENDED_SELECT and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with auto_selection_type set to XmAUTO_NO_CHANGE. Otherwise, it will be set to XmAUTO_CHANGE.
ListEndLine()β Moves the horizontal scroll region to the end of the line.ListEndSelect()β This action moves the location cursor to the last item selected or deselected and calls the appropriate selection callbacks (XmNsingleSelectionCallbackwhenXmNselectionPolicyis set toXmSINGLE_SELECT,XmNbrowseSelectionCallbackwhenXmNselectionPolicyis set toXmBROWSE_SELECT,XmNmultipleSelectionCallbackwhenXmNselectionPolicyis set toXmMULTIPLE_SELECT,XmNextendedSelectionCallbackwhenXmNselectionPolicyis set toXmEXTENDED_SELECT).
ListEndToggle() πΈ
- If
XmNselectionPolicyis set toXmEXTENDED_SELECT, it moves the location cursor to the last item selected or deselected and calls theXmNextendedSelectionCallbackcallbacks. - If
XmNautomaticSelectionis set toTrue, then theauto_selection_typefield of the callback will be valid. IfXmNselectionPolicyis set toXmBROWSE_SELECTand the currently selected item position matches the position of the item that was selected before the browse selection began, or ifXmNselectionPolicyis set toXmEXTENDED_SELECTand the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called withauto_selection_typeset toXmAUTO_NO_CHANGE. Otherwise, it will be set toXmAUTO_CHANGE.
ListExtendNextItem() β¨
If XmNselectionPolicy is set to XmEXTENDED_SELECT, this action does the following: if an extended selection has been made from the current anchor point, it restores the selection state of the items in that range to their state before the extended selection was done; then it moves the location cursor to the next item and changes the selection state of the item and all items between it and the current anchor point to the state of the item at the current anchor point; and then it calls the XmNextendedSelectionCallback callbacks.
ListExtendPrevItem() π¦
If XmNselectionPolicy is set to XmEXTENDED_SELECT, this action does the following: if an extended selection has been made from the current anchor point, it restores the selection state of the items in that range to their state before the extended selection was done; then it moves the location cursor to the previous item and changes the selection state of the item and all items between it and the current anchor point to the state of the item at the current anchor point; and then it calls the XmNextendedSelectionCallback callbacks.
ListScrollCursorVertically(percentage) π
Scrolls the line containing the insertion cursor vertically to an intermediate position in the visible window, based on an input percentage. A value of 0 (zero) means the top of the window; a value of 100 means the bottom of the window. And if this action gets called with no argument at all, then the line containing the insertion cursor gets scrolled vertically to a new position designated by the y event passed to the routine. π
ListKbdActivate() π₯
Calls the callbacks for XmNdefaultActionCallback. And if the List's parent is a manager, this action passes the event to the parent.
ListKbdBeginExtend() π
If XmNselectionPolicy is set to XmEXTENDED_SELECT, it does the following: if an extended selection has been made from the current anchor point, it restores the selection state of the items in that range to their state before the extended selection was done; then it changes the selection state of the item at the location cursor and all items between it and the current anchor point to the state of the item at the current anchor point.
If XmNautomaticSelection is set to True, this action calls the XmNextendedSelectionCallback callbacks. The auto_selection_type component of the callback structure will be set to XmAUTO_BEGIN.
ListKbdBeginSelect() π
Depends on your policy, bestie. Pick your lane:
- If the
XmNselectionPolicyis set toXmSINGLE_SELECT, it deselects any current selection and toggles the state of the item at the location cursor. Theauto_selection_typecomponent of the callback structure will be set toXmAUTO_BEGIN. - If the
XmNselectionPolicyis set toXmBROWSE_SELECT, it deselects any current selection and selects the item at the location cursor. IfXmNautomaticSelectionis set toTrue, it calls theXmNbrowseSelectionCallbackcallbacks. - If the
XmNselectionPolicyis set toXmMULTIPLE_SELECT, it toggles the selection state of the item at the location cursor. Any previous selections remain β no wiping the slate. - If the
XmNselectionPolicyis set toXmEXTENDED_SELECT, it moves the current anchor to the item at the location cursor. In Normal Mode, this action deselects any current selection and selects the item at the location cursor. In Add Mode, this action toggles the selection state of the item at the location cursor and leaves the current selection unchanged. IfXmNautomaticSelectionis set toTrue, this action calls theXmNextendedSelectionCallbackcallbacks. Theauto_selection_typecomponent of the callback structure will be set toXmAUTO_BEGIN.
ListKbdCancel() π
If XmNselectionPolicy is set to XmEXTENDED_SELECT and an extended selection is being made from the current anchor point, this action cancels the new selection and restores the selection state of the items in that range to their state before the extended selection was done. If XmNautomaticSelection is set to True, this action calls the XmNextendedSelectionCallback callbacks; otherwise, if the parent is a manager, it passes the event to the parent. The auto_selection_type component of the callback structure will be set to XmAUTO_CANCEL.
ListKbdDeSelectAll() π
If the XmNselectionPolicy is set to XmSINGLE_SELECT, XmMULTIPLE_SELECT, or XmEXTENDED_SELECT in Add Mode, this action deselects all items in the list. And if the XmNselectionPolicy is set to XmEXTENDED_SELECT in Normal Mode, this action deselects all items in the list β with one little exception: the item at the location cursor stays selected if the shell's XmNkeyboardFocusPolicy is XmEXPLICIT.
This action also calls the appropriate selection callbacks: XmNsingleSelectionCallback when XmNselectionPolicy is set to XmSINGLE_SELECT, XmNmultipleSelectionCallback when XmNselectionPolicy is set to XmMULTIPLE_SELECT, and XmNextendedSelectionCallback when XmNselectionPolicy is set to XmEXTENDED_SELECT.
ListKbdEndExtend() π
If XmNselectionPolicy is set to XmEXTENDED_SELECT, this action calls the XmNextendedSelectionCallback callbacks.
If XmNautomaticSelection is set to True, then the auto_selection_type field of the callback will be valid. If XmNselectionPolicy is set to XmBROWSE_SELECT and the currently selected item position matches the position of the item that was selected before the browse selection began, or if XmNselectionPolicy is set to XmEXTENDED_SELECT and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with auto_selection_type set to XmAUTO_NO_CHANGE. Otherwise, it will be set to XmAUTO_CHANGE.
ListKbdEndSelect() π
Calls the appropriate selection callbacks: XmNsingleSelectionCallback when XmNselectionPolicy is set to XmSINGLE_SELECT, XmNbrowseSelectionCallback when XmNselectionPolicy is set to XmBROWSE_SELECT, XmNmultipleSelectionCallback when XmNselectionPolicy is set to XmMULTIPLE_SELECT, and XmNextendedSelectionCallback when XmNselectionPolicy is set to XmEXTENDED_SELECT.
If XmNautomaticSelection is set to True, then the auto_selection_type field of the callback will be valid. If XmNselectionPolicy is set to XmBROWSE_SELECT and the currently selected item position matches the position of the item that was selected before the browse selection began, or if XmNselectionPolicy is set to XmEXTENDED_SELECT and the set of currently selected item positions matches the set of item positions selected before the extended selection began, the callback will be called with auto_selection_type set to XmAUTO_NO_CHANGE. Otherwise, it will be set to XmAUTO_CHANGE.
ListKbdSelectAll() β
If XmNselectionPolicy is set to XmSINGLE_SELECT or XmBROWSE_SELECT, this action selects the item at the location cursor. If XmNselectionPolicy is set to XmEXTENDED_SELECT or XmMULTIPLE_SELECT, it selects all the items in the list. π
This action also calls the appropriate selection callbacks: XmNsingleSelectionCallback when XmNselectionPolicy is set to XmSINGLE_SELECT, XmNbrowseSelectionCallback when XmNselectionPolicy is set to XmBROWSE_SELECT, XmNmultipleSelectionCallback when XmNselectionPolicy is set to XmMULTIPLE_SELECT, and XmNextendedSelectionCallback when XmNselectionPolicy is set to XmEXTENDED_SELECT.
ListLeftChar() π§
Scrolls the list one character to the left. Tiny little scoot. π«Ά
ListLeftPage() πΈ
Scrolls the list one page to the left. Big scoot energy.
ListNextItem() π₯
Moves the location cursor to the next item in the list.
- If the
XmNselectionPolicyis set toXmBROWSE_SELECT, this action also selects the next item, deselects any current selection, and calls theXmNbrowseSelectionCallbackcallbacks. - If the
XmNselectionPolicyis set toXmEXTENDED_SELECT, this action in Normal Mode also selects the next item, deselects any current selection, moves the current anchor to the next item, and calls theXmNextendedSelectionCallbackcallbacks. In Add Mode, this action does not affect the selection or the anchor. Periodt. π ListNextPage()β scrolls the list to the next page and moves the location cursor onto a new item. π«
If XmNselectionPolicy is set to XmBROWSE_SELECT, this action also selects the new item, deselects whatever was selected before, and calls the XmNbrowseSelectionCallback callbacks.
If XmNselectionPolicy is set to XmEXTENDED_SELECT, then in Normal Mode this action also selects the new item, deselects any current selection, moves the current anchor to the new item, and calls the XmNextendedSelectionCallback callbacks. In Add Mode, bestie, this action does not touch the selection or the anchor. periodt.
ListPrevItem()β moves the location cursor to the previous item in the list. β¬ οΈ
If XmNselectionPolicy is set to XmBROWSE_SELECT, this action also selects the previous item, deselects any current selection, and calls the XmNbrowseSelectionCallback callbacks.
If XmNselectionPolicy is set to XmEXTENDED_SELECT, this action in Normal Mode also selects the previous item, deselects any current selection, moves the current anchor to the previous item, and calls the XmNextendedSelectionCallback callbacks. In Add Mode, it does not affect the selection or the anchor.
ListPrevPage()β scrolls the list to the previous page, moving the location cursor to a new item. π¦
If XmNselectionPolicy is set to XmBROWSE_SELECT, this action also selects the new item, deselects any current selection, and calls the XmNbrowseSelectionCallback callbacks.
If XmNselectionPolicy is set to XmEXTENDED_SELECT, this action in Normal Mode also selects the new item, deselects any current selection, moves the current anchor to the new item, and calls the XmNextendedSelectionCallback callbacks. In Add Mode this action does not affect the selection or the anchor.
ListProcessBtn1(string)β okay so when Display'sXmNenableBtn1Transferresource is notXmOFF, the actions for selection and transfer are integrated on<Btn1>. When the button is not performing a transfer or drag, the action that gets performed depends on the value ofstring, which can be one of these:ListButtonMotionListBeginExtendListEndExtendListBeginToggleListEndToggleListBeginSelectListEndSelect
ListProcessBtn2β when Display'sXmNenableBtn1Transferresource has a value ofXmBUTTON2_TRANSFER, the actions for extending selection are bound on<Btn2>, and a drag starts immediately. πββοΈ When Display'sXmNenableBtn1Transferresource has a value ofXmBUTTON2_ADJUST, the action that is performed depends on the value ofstring, which can be one of these:ListBeginExtendListButtonMotionListEndExtend
ListProcessDrag()β drags the content of one or more selected list items. Each item is separated by a newline. IfBTransferis pressed on an unselected item, it drags only that item, excluding any other selected items. This action sets theXmNconvertProcof theDragContextto a function that calls theXmNconvertCallbackprocedures, possibly multiple times, for the_MOTIF_DROPselection. π«³β¨ListQuickNavigateβ navigates to an item. When List'sXmNmatchBehaviorresource isXmQUICK_NAVIGATE, this action uses 1-character navigation to navigate. Go peek at theXmNmatchBehaviorresource for a description of how this navigation works. iykyk.ListRightChar()β scrolls the list one character to the right. β‘οΈListRightPage()β scrolls the list one page to the right.PrimitiveHelp()β calls the callbacks forXmNhelpCallbackif any exist. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them. πPrimitiveNextTabGroup()β moves the focus to the first item contained within the next tab group. If the current tab group is the last entry in the tab group list, it wraps to the beginning of the tab group list. πPrimitivePrevTabGroup()β moves the focus to the first item contained within the previous tab group. If the beginning of the tab group list is reached, it wraps to the end of the tab group list.
β¨ Additional Behavior β¨
The List widget has the following additional behavior, and yes this is its own little moment:
<Double Click>β if a button click is followed by another button click within the time span specified by the display's multiclick time, the List interprets that as a double click and calls the callbacks forXmNdefaultActionCallback. The item's colors invert to indicate that it is selected. TheXmNdoubleClickIntervalresource can be used to specify a time span that overrides the display's multi-click time. ππ<FocusIn>β if the focus policy isExplicit, this action sets the focus and draw the location cursor.<FocusOut>β if the focus policy isExplicit, this action removes the focus and erase the location cursor.
π Virtual Bindings π
The bindings for virtual keys are vendor specific, no cap β every vendor does their own thing. For information about bindings for virtual buttons and keys, see VirtualBindings(3).
π RELATED π
The whole friend group, in order: Core(3), XmCreateList(3), XmCreateScrolledList(3), XmFontListCreate(3), XmFontListAppendEntry(3), XmListAddItem(3), XmListAddItems(3), XmListAddItemUnselected(3), XmListAddItemsUnselected(3), XmListDeleteAllItems(3), XmListDeleteItem(3), XmListDeleteItems(3), XmListDeleteItemsPos(3), XmListDeletePos(3), XmListDeletePositions(3), XmListDeselectAllItems(3), XmListDeselectItem(3), XmListDeselectPos(3), XmListGetKbdItemPos XmListGetMatchPos(3), XmListGetSelectedPos(3), XmListItemExists(3), XmListItemPos(3), XmListPosToBounds(3), XmListReplaceItems(3), XmListReplaceItemsPos(3), XmListReplaceItemsPos(3), XmListReplaceItemsPosUnselected(3), XmListReplaceItemsUnselected(3), XmListSelectItem(3), XmListSelectPos(3), XmListSetAddMode(3), XmListSetBottomItem(3), XmListSetBottomPos(3), XmListSetHorizPos(3), XmListSetItem(3), XmListSetKbdItemPos(3), XmListSetPos(3), XmListUpdateSelectedList(3), XmListYToPos(3), XmPrimitive(3) XmStringCreate(3), XmVaCreateList(3), and XmVaCreateManagedList(3).
And that's the whole page, bestie β you made it to the end of the List saga. π This one's from the XmList library call manual, and it's dated the classic Motif manpage era (that source/version + date line lives at the footer of the original). Go forth and select responsibly. π π¦
π¦ 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