XmMultiList(3x)
πΈ NAME
XmMultiList β the Multi-column List widget, aka the manual page XmMultiList(3x) π
β¨ SYNOPSIS
#include <Xm/MultiList.h>
π DESCRIPTION
okay bestie, sit down, because this widget is a lot and also lowkey iconic. XmMultiList is a multi-column list β headers chilling along the top π, and a search area hanging out along the bottom. The list itself has scrollbars along the right and bottom edges, and those scrollbars let you scroll vertically and horizontally, both by column and by pixel. slay.
The part of the list data that's visible right now? That can change in three ways, periodt:
- scrollbar actions
- widget resource setting
- the redisplay of the list data after a string search has been successful
The sorting of elements within a particular column is also supported β¨. To sort the list by the elements in a given column, select the column's title. that's it. that's the whole vibe check.
π the search situation
To search for a particular string in the list, type the string value you're looking for into the list's associated text field, then press the "Find" pushbutton π«Ά.
The search for the string begins in the currently selected row, after the location of the previously searched for string, or at the first column and first row if there is no column selected.
If the string is not found in that row, then the search continues through all rows after and then before the currently selected row. If the string is found, the display of the list is adjusted to make the string visible.
If the string was not found, or if the string is visible, the application will issue a warning beep π. (yes really. beep. sorry.)
π±οΈ the pointer situation
Pointer button one allows the user to select a row or a column for sorting. The callbacks on the doubleClickCallback list are called when the user double clicks pointer button one. If the list data can contain a row pixmap to display at the extreme left of the row. π
𧬠Classes
MultiList inherits behavior, resources, and traits from:
CoreCompositeConstraintXmManager
The class pointer is xmMultiListWidgetClass.
The class name is XmMultiList.
π New Resources
The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). π
The codes in the access column indicate if the given resource can be:
- set at creation time (
C) - set by using
XtSetValues(S) - retrieved by using
XtGetValues(G) - or is not applicable (
N/A)
no cap, those access codes are gonna matter for every single row of the table, so keep them in your notes bestie π
β¨ XmMultiList Resource Set β¨
okay bestie, buckle up π here is literally every resource this widget has, with its class, type, default and access mode, because we do not gatekeep info in this house:
XmNcolumnTitlesβ class:XmCColumnTitles, type:XmString *, default:NULL, access:CSGXmNdoubleClickCallbackβ class:XmCCallback, type:XtCallbackList, default:NULL, access:CXmNentryDataβ class:XmCEntryData, type:XtPointer, default:NULL, access:CSGXmNfindLabelβ class:XmCFindLabel, type:XmString, default:Find, access:CSGXmNfirstColumnβ class:XmCFirstLocation, type:short, default:0, access:CSGXmNfirstColumnPixmapsβ class:XmCFirstColumnPixmaps, type:Boolean, default:False, access:CSGXmNfirstRowβ class:XmCFirstLocation, type:short, default:0, access:CSGXmNfontListβ class:XmCFontList, type:XmFontList, default: dynamic, access:CSGXmNheightβ class:XmCHeight, type:Dimension, default:300, access:CSGXmNnumColumnsβ class:XmCNumColumns, type:short, default:0, access:CSGXmNnumRowsβ class:XmCNumRows, type:short, default:0, access:CSGXmNselectedColumnβ class:XmCSelectedColumn, type:short, default:0, access:CSGXmNselectionPolicyβ class:XmCSelectionPolicy, type:unsigned char, default:XmEXTENDED_SELECT, access:CSGXmNshowFindβ class:XmCShowFind, type:Boolean, default:True, access:CSGXmNsingleSelectionCallbackβ class:XmCCallback, type:XtCallbackList, default:NULL, access:CSGXmNsortFunctionsβ class:XmCFunction, type:XmMultiListSortFunction **, default:NULL, access:CSGXmNtitleβ class:XmCTitle, type:XmString, default:NULL, access:CSGXmNwidthβ class:XmCWidth, type:Dimension, default:300, access:CSG
and now the β¨loreβ¨ on each one, going down the list like the good student you are π¦
XmNcolumnTitles
this one is an array of length numColumns of strings, and it's literally what gets displayed at the top of each column π the data is allocated and maintained by the client β yes bestie, that means you, so don't come crying when it leaks π
XmNdoubleClickCallback
every single routine in this list gets called whenever the user double clicks on a row in the list π₯ double-click girlies stay winning.
XmNentryData
this resource is the data associated with each row in the list. the data is an array of XmMultiListRowInfo structures of length numRows, allocated by the client. allocated and maintained by the client, fr fr. the XmMultiListRowInfo structure is defined further down π
XmNfindLabel
the label to be shown on the find button π that's it, that's the resource, she's simple and she serves.
XmNfirstColumn
this resource lets the client adjust the current view of the list data so it has a new top left column location π but listen β when you're setting this resource, firstRow should also be updated. they're a package deal, iykyk π
XmNfirstColumnPixmaps
this resource specifies that the pixmap stored in the row info structure should be used instead of XmMultiListRowInfo values[0] πΌοΈ if pixmaps are present, the rows may be dragged by pressing on the pixmap with pointer button three. and pay attention bestie: if this resource is True, then values[0] is never referenced. if False, then the XmMultiListRowInfo data pixmap is never referenced. it's one or the other, no in-between, periodt.
XmNfirstRow
this resource lets the client adjust the current view of the list data so it has a new top left row location. same rule as her sister: when you're setting this resource, firstColumn should also be updated πΈ
XmNfontList
this is an OSF/Motif style font list π the first font in this list will be used to display all text in the MultiList widget. and here's the tea β the MultiList widget currently supports only one font. so don't get cute with a whole font list, she's monogamous π
okay we're only partway through the resource breakdown, so don't go anywhere β more coming π«Ά
XmNheightβ the overall height value handed to the MultiList widget. Change this one and the scrollbar size and location get affected too, so heads up πXmNnumColumns,XmNnumRowsβ these two say how many columns and rows the widget expects to display. They're used as the maximum indices for a bunch of the other resources in this widget, so if you modify them, please please please make sure you've updated the other values too. Care should be taken, bestie. That's the rule. πXmNselectedColumnβ the index of the currently selected column. It's also the column the list is being sorted by. Two jobs, one resource, main character energy fr.XmNselectionPolicyβ defines how the select action gets interpreted. It can beXmSINGLE_SELECTorXmEXTENDED_SELECT. Any other value β undefined behavior, and we do not do undefined behavior in this house πXmNshowFindβ a boolean that manages and unmanages the find button. that's it. that's the whole resource. iconic.XmNsingleSelectionCallbackβ every routine in this list gets called whenever the user clicks on a line in the list. A pointer to theXmMultiListRowInfostructure for the line that got selected is passed ascall_data. β οΈ But if you're in extended select mode, the value ofcall_datais undefined.XmNsortFunctionsβ an array of functions, one for each column, called to figure out the ordering of the rows in that column. Think of it likeqsort, but for your list β¨XmNtitleβ the title displayed at the top of the MultiList widget. If this value isNULL, the title area just won't be shown at all. gone. vanished. π«₯XmNwidthβ the overall width value assigned to the MultiList widget. Same deal asXmNheight: modifying it affects scrollbar size and location.
π§Έ Specifying Children Resources
okay so here's the tea: the MultiList widget is actually a whole composed situation β it's made of many simple widgets. And sometimes, to get full functionality out of the Toolkit, you wanna set attribute values directly on those sub-widgets. Totally valid. π
To do that you grab the widget ids of the sub-widgets using the XtNameToWidget() function from the Xt Intrinsics.
Here's the family tree π³:
XmMultiList <named by application>
XmLabel title
XmScrollbar vertBar
XmScrollBar horizBar
XmFrame frame
XmPushButton find
XmText findText
ποΈ Using the Resource Database
Real talk: the MultiList widget is a collection of pieces. It gives you the geometry layout for the whole collection and ties the pieces together into one consistent package. Very glue. Very mother. π
But here's the catch β lots of the resources documented as being part of the MultiList widget are really part of the internal list sub-component. When you set those values at creation time, or with XtSetValues or XtGetValues, the MultiList widget passes them straight through to the proper child. Easy.
But when you're setting a resource via the resource database, you have to use either the name of the child or the general specification (*) rather than the specific one (.). Do not skip this. fr fr.
πΈ The XmMultiListRowInfo Structure
This structure holds the entryData associated with each Row in the List.
typedef struct {
String * values; /* The array of column strings */
Pixmap pixmap; /* mini-icon pixmaps. */
Boolean selected; /* row selected. */
/*
* Provided for the convenience of the application programmer
*/
short * sort_id;
XtPointer data;
/*
* Private to the MultiList widget (do not modify these)
*/
short pix_width; /* of the pixmap. */
short pix_height; /* of the pixmap. */
short pix_depth; /* of the pixmap. */
Boolean old_sel_state;
} XmMultiListRowInfo;
Now let's break down the members, one by one π
valuesβ an array of strings of lengthnumColumns, representing the strings displayed in each column of this row. The data is allocated and maintained by the client. IffirstColumnPixmapsisTrue, thenvalue[0]is never referenced.pixmapβ the pixmap displayed to the left of this row. IffirstColumnPixmapsisTrue, then this value is never referenced and mayn remain unset. And if you don't want a pixmap for this row, even thoughfirstColumnPixmapsisTrue, just set the value ofpixmaptoNone. Color pixmaps may be used πsort_idβ provided for the convenience of the client, and it's expected to be used as a sort index for this row. You should specify one value for each column of the row. See "sortFunctions" below for details. πdataβ provided for the convenience of the client and can be used for literally any purpose. It's intended to be used as an identifier for the object pointed to by this row.selectedβTrueif this row is selected; may be set by the application.
Neithersort_idnordataare used by the MultiList widget; they exist solely for the convenience of the programmer. So like, they're yours. enjoy π«Ά
πΈ XmManager Resource Set πΈ
okay bestie, here's everything our girl inherits from XmManager. every single one, no skips, no cap π
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGβ¨XmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGπXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGπXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπ«ΆXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGβXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGπXmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultdynamic, accessCSGπXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCGπ¦XmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSGπ₯XmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCπXmNshadowThicknessβ classXmCShadowThickness, typeDimension, defaultdynamic, accessCSGπXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCGπΈXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGπXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGβ¨XmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSGπ§XmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGπXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSGπ
lowkey obsessed with how many of these defaults are just dynamic. she doesn't commit to a value until she has to. main character energy fr fr.
π¦ Composite Resource Set π¦
and these are the ones coming straight from Composite β only three of them, tiny but mighty π
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessGπXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSGπ«XmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessGβ
not theGonXmNchildrenandXmNnumChildrenβ read-only, bestie. you can look, you can't touch π
okay so now we're in the core resource set, bestie β¨ Here's every single one β name, class, type, default, access β no skips, no cap:
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessN/AXmNancestorSensitiveβ 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
π Translations π
These are the default translation bindings the icon button uses, periodt:
~Ctrl ~Shift <Btn1Down>: ButtonDown()
Ctrl ~Shift <Btn1Down>: ButtonDown(Toggle)
~Ctrl Shift <Btn1Down>: ButtonDown(Extend)
Button1 <Motion>: Motion()
<Btn1Up>: ButtonUpOrLeave()
And here are the actions the MultiList supports, bestie:
ButtonDown(type)β Handles a button press that could start a select or a double click. The type argument can be eitherToggleorExtendβ these decide which mode of an extended select gets initiated on this button event. Go check the OSF/Motif Style Guide for the full tea, fr fr.Motion()β Handles motion events so the selection region can be modified while you're in extended selection mode. It's assumed this action gets called between aButtonDown()and aButtonUpOrLeave()action, no cap.ButtonUpOrLeave()β Cleans up afterButtonDown()andMotion(). The designated cleanup crew π
β¨ Callback Routines β¨
okay so bestie, listen up π Every procedure chillin' on the MultiList's singleSelectionCallback and doubleClickCallback lists gets a pointer to an XmMultiListRowInfo structure slid into its call_data field. That structure is defined above, so you already know the vibe. π
β οΈ Note: if a singleSelectionCallbackis registered on an MultiList that's inextended_select_mode, the value ofcall_datais undefined β like, do not touch it, it's giving absolute chaos. ππ
void (callback)(Widget w, XtPointer client_data, XtPointer call_data)
wβ the MultiList widget itself, the main character πclient_dataβ the client data specified by the application, no capcall_dataβ a pointer to anXmMultiListRowInfostructure corresponding to the row that got selected, periodt.
π₯ Sort Function π₯
Here's the sort function vibe check, bestie β¨
typedef int (XmMultiListSortFunction) (short column, XmMultiRowInfo * row1, XmMultiRowInfo * row2);
columnβ the column currently being sorted, iykykrow1,row2β the two rows being compared, like a versus battle. The return value must be an integer less than, equal to, or greater than 0, depending on whether the first argument is less than, equal to, or greater than the second. So ifrow1is less thanrow2, return something < 0; if they're equal, return 0; ifrow1is greater, return something > 0. Slay. π
π RELATED π
You might also wanna peek at these besties π
Composite(3), Constraint(3), Core(3), XmCreateMultiList(3), XmManager(3), XmMultiListDeselectAllItems(3), XmMultiListDeselectItem(3), XmMultiListDeselectItems(3), XmMultiListDeselectRow(3), XmMultiListGetSelectedRowArray(3), XmMultiListGetSelectedRows(3), XmMultiListMakeRowVisible(3), XmMultiListSelectAllItems(3), XmMultiListSelectItems(3), XmMultiListSelectRow(3), and XmMultiListToggleRow(3).
π COPYRIGHT π
Copyright (c) 1992 by Integrated Computer Solutions, Inc. β periodt. Don't be stealing this, bestie. π
And that's the tea! βοΈ This whole page is from XmMultiList(3x) β that's the source/version right there in the footer. The date isn't listed on this page, but you know it's iconic. Stay slaying, bestie! πβ¨π¦
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms