XxExt18LIst(3x)

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

πŸ’– XxExt18LIst(3x) β€” the Internationalized Extended List widget πŸ’–

okay bestie, sit down, hydrate, because this is the iconic one. this is the manual page for XxExt18LIst, aka the Internationalized Extended List widget. it's a whole vibe. it's a lot. but you're gonna slay it, fr fr. 🫢


✨ SYNOPSIS ✨

#include <Xm/Ext18List.h>

🌸 DESCRIPTION 🌸

okay so picture this: this widget is a multi-column list with headers along the top and a search area along the bottom. that's the whole lewk. πŸ’…

the list has scrollbars along the right and bottom edges, and they let you scroll vertically and horizontally β€” both by column and by pixel. fancy, right? the part of the list data that's currently visible can get changed up by:

  • scrollbar actions
  • setting widget resources
  • the redisplay of the list data after a string search has been successful

and yes, sorting elements within a particular column is supported too. to sort the list by the elements in a given column, you just select that column's title. easy. periodt. πŸ‘‘


πŸ” the search situation πŸ”

to search for a particular string in the list, you type the string value you're looking for into the list's associated text field, then press the "Find" pushbutton.

here's the tea on how the search actually goes, bestie, don't skip this part:

  • 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 isn't 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 already visible, the application will issue a warning beep. 😭 iconic honestly.

πŸ–±οΈ pointer button one πŸ–±οΈ

Pointer button one lets the user select a row or a column for sorting.

the callbacks on the doubleClickCallback list are called when the user double clicks pointer button one.

oh and β€” if the list data can contain a row pixmap, it gets displayed at the extreme left of the row. cute. πŸŽ€


✨ Normal Resources ✨

here's the full roster, no skips, no cuts, every single one. πŸ’–

heads up: all resource names begin with XmN and all resource class names begin with XmC.
  • columnTitles β€” class ColumnTitles, type String *, default NULL
  • doubleClickCallback β€” class Callback, type Callback, default NULL
  • entryData β€” class EntryData, type Xm18RowInfo*, default NULL
  • findLabel β€” class XmString, type XmString, default Find
  • firstColumn β€” class FirstLocation, type short, default 0
  • firstColumnPixmaps β€” class FirstColumnPixmaps, type Boolean, default False
  • firstRow β€” class FirstLocation, type short, default 0
  • fontList β€” class FontList, type FontList, default "fixed"
  • height β€” class Dimension, type VerticalDimension, default 300
  • numColumns β€” class NumColumns, type short, default 0
  • numRows β€” class NumRows, type short, default 0
  • selectedColumn β€” class SelectedColumn, type short, default 0
  • selectionPolicy β€” class SelectionPolicy, type SelectionPolicy, default XmEXTENDED_SELECT
  • showFind β€” class boolean, type boolean, default True
  • singleSelection β€” class Callback, type Callback, default NULL
  • sortFunctions β€” class Function, type Function, default NULL
  • title β€” class Title, type String, default name of widget
  • width β€” class Dimension, type Horizontal Dimension (no default given)

πŸŽ€ columnTitles

this is an array of length numColumns of strings displayed at the top of each column. the data is allocated and maintained by the client. you got this. 🫢

πŸŽ€ doubleClickCallback

all routines in this list will be called whenever the user double clicks on a row in the list.

πŸŽ€ entryData

this resource is the data associated with each row in the list. the data is an array of Xm18RowInfo structures of length numRows allocated by the client. the data is allocated and maintained by the client. the Xm18RowInfo structure is defined below. πŸ‘‡

πŸŽ€ findLabel

the label to be shown on the find button.

πŸŽ€ firstColumn

this resource lets the client adjust the current view of the list data to have a new top left column location. when setting this resource, firstRow should also be updated. don't forget, bestie!!

πŸŽ€ firstColumnPixmaps

this resource specifies that the pixmap stored in the row info structure should be used instead of Xm18RowInfo values[0].

if pixmaps are present, the rows may be dragged by pressing on the pixmap with pointer button three.

  • if this resource is True, then values[0] is never referenced.
  • if False, then the Xm18RowInfo data pixmap is never referenced.

πŸŽ€ firstRow

this resource lets the client adjust the current view of the list data to have a new top left row location. when setting this resource, firstColumn should also be updated. yes this is the mirror of the last one, no we are not skipping it. πŸ’…

πŸŽ€ fontList

this is an OSF/Motif style font list. the first font in this list will be used to display all text in the Extended List widget. the Extended List widget currently supports only one font. so don't get cute with it. πŸ™ˆ

πŸŽ€ height

this is the overall height value assigned to the Extended List widget. modifying this resource will affect scrollbar size and location.

πŸŽ€ numColumns / numRows

these resources specify the number of columns and rows the widget expects to display. these resources are used as the maximum indices for many of the other resources in this widget.

⚠️ care should be taken when modifying these resources to ensure that the other values have also been modified. it's giving domino effect, lowkey.

πŸŽ€ selectedColumn

this is the index of the currently selected column. this is also the column by which the list is being sorted. two jobs, one resource, main character energy. πŸ‘‘

πŸŽ€ selectionPolicy

defines the interpretation of the select action. this resource can have the values XmSINGLE_SELECT or XmEXTENDED_SELECT.

🚨 other values result in undefined behavior. so like... don't.

πŸŽ€ showFind

this boolean manages and unmanages the find button.

πŸŽ€ singleSelectionCallback

all routines in this list will be called whenever the user clicks on a line in the list. a pointer to the Xm18RowInfo structure corresponding to the line selected is passed as call_data.

⚠️ if in extended select mode, the value of call_data is undefined. just so you know. fr fr.

πŸŽ€ sortFunctions

this is an array of functions, one for each column, called to determine the ordering of the rows in the column, similar to qsort.

πŸŽ€ title

this is the title that is displayed at the top of the Extended List widget. if this value is NULL, the title area will not be shown. gone. poof. πŸ¦‹

πŸŽ€ width

this is the overall width value assigned to the Extended List widget. modifying this resource will affect scrollbar size and location.


🧚 Specifying Children Resources 🧚

okay so the Extended List widget is composed of many simple widgets. in order to achieve full functionality of the Toolkit, it is sometimes desirable to set attribute values directly on those widgets. the widget ids of the sub-widgets can be obtained by using the XtNameToWidget() function provided by the Xt Intrinsics.

here's the whole family tree, bestie 🌳:

XmExt18List <named by application>

     XmLabel title

     XmScrollbar vertBar

     XmScrollBar horizBar

     XmFrame frame

     XmPushButton find

     XmText findText

(yes, XmScrollbar and XmScrollBar are both in there, that's not a typo on my end, that's literally what it says, i am simply the messenger πŸ’€)


πŸ’… Using the Resource Database πŸ’…

the Extended List widget is actually a collection of pieces. it provides the geometry layout for the collection as well as tying together the pieces to form a consistent package. it's giving girlboss project manager.

many of the resources that are documented as being part of the Extended List widget are really part of the internal list sub-component. the Extended List widget will pass these values through to the proper child when they are set at time of creation or with XtSetValues or XtGetValues.

⚠️ however, when setting a resource via the resource database you must use either the name of the child or the general specification (*) rather than the specific one (.). do not come for me, that's just the rules.

🌈 The Xm18RowInfo Structure 🌈

the Xm18RowInfo structure is used to contain the entryData associated with each Row in the Extended List.

typedef struct _Xm18RowInfo{

/*

 * Used by the IList widget

 */

    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 Extended List 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;

} Xm18RowInfo;

okay now let's break down every single field because we are thorough in this house 🫢:

  • values β€” this is an array of strings of length numColumns which represents the strings displayed in each column of this row. the data is allocated and maintained by the client. if firstColumnPixmaps is True, then value[0] is never referenced.
  • pixmap β€” this is the pixmap displayed to the left of this row. if firstColumnPixmaps is True then this value is never referenced and mayn remain unset. (yes, "mayn". we keep the typos in this house, that's canon πŸ’€) if no pixmap is desired for this row, even though firstColumnPixmaps is True, set the value of pixmap to None. color pixmaps may be used. slay.
  • sort_id β€” this is provided for the convenience of the client and is expected to be used as a sort index for this row. one value should be specified for each column of the row. see "sortFunctions" below for details.
  • data β€” this is provided for the convenience of the client and may be used for any purpose. it is intended to be used as an identifier for the object pointed to by this row.
  • selected β€” this value is True if this row is selected; may be set by the application.
πŸ’‘ neither sort_id nor data are used by the Extended List widget; they exist solely for the convenience of the programmer. free real estate, basically.

✨ Translations and Actions ✨

the following are the default translation bindings used by the icon button:

~Ctrl ~Shift <Btn1Down>:   ButtonDown()
Ctrl ~Shift <Btn1Down>:    ButtonDown(Toggle)
~Ctrl Shift <Btn1Down>:    ButtonDown(Extend)
Button1 <Motion>:          Motion()
<Btn1Up>:                  ButtonUpOrLeave()

the following actions are supported by the icon button:

πŸŽ€ ButtonDown(type)

processes a button press action that may begin with either a select or a double click. the type argument can be either Toggle or Extend. these values determine which mode of an extended select will be initiated on this button event. consult the OSF/Motif Style Guide for details. iykyk. πŸ“–

πŸŽ€ Motion()

processes motion events to allow the selection region to be modified when in extended selection mode. it is assumed that this action is called between a ButtonDown() and ButtonUpOrLeave() action.

πŸŽ€ ButtonUpOrLeave()

cleans up after ButtonDown() and Motion(). it's the responsible friend who makes sure everyone got home safe. 🫢


part 1 of 2 β€” keep scrolling bestie, there's more πŸ’œ

✨ Callback Routines ✨

okay so bestie, every single procedure hanging out on the Extended List's singleSelectionCallback and doubleClickCallback lists is gonna get a pointer to a Xm18RowInfo structure handed to it in the call_data field. That structure? Already defined up above, you got this. πŸ’–

🚨 IMPORTANT NOTE, FR FR: if a single SelectionCallback is registered on an extended list in extended_select_mode, the value of call_data is undefined. Not "kinda weird", not "maybe fine" β€” undefined. Proceed accordingly bestie πŸ’€
void (callback)(Widget w, XtPointer client_data, XtPointer call_data)
  • w β€” the Extended List widget itself, the main character πŸ‘‘
  • client_data β€” the client data your application specified, no notes
  • call_data β€” a pointer to a Xm18RowInfo structure corresponding to the row selected (yes the original says "corrsponding", typo and all, we keep it πŸ’…)

πŸ¦‹ Sort Function πŸ¦‹

typedef int (Xm18SortFunction) (short column, Xm18RowInfo * row1,
                    Xm18RowInfo * row2);
  • column β€” the column currently being sorted
  • row1, row2 β€” the two rows being compared. The return value has to be an integer that's less than, equal to, or greater than 0, depending on whether the first argument is less than, equal to, or greater than the second. Classic comparator behaviour, you know the vibe 🌸

🫢 Convenience Routines 🫢

XmExt18ListGetSelectedRows

Xm18RowInfo ** XmExt18ListGetSelectedRows (Widget w)
  • w β€” extended list widget

Use the XmExt18ListGetSelectedRows function to find the rows that are currently selected in an extended list. The Xm18RowInfo ** that this function hands back contains a NULL terminated array of Xm18RowInfo pointers. And listen β€” you, the calling routine, are responsible for freeing that returned pointer with XtFree(). Your memory, your problem bestie πŸ™ˆ. If no elements are selected, the function will return NULL.


XmCreateExtended18List

Widget XmCreateExtended18List(Widget parent, String name,
                     ArgList args, Cardinal num_args)
  • parent β€” parent of the extended list widget to be created
  • name β€” name of the extended list widget to be created
  • args β€” arguments to pass to XtCreateWidget for the extended list
  • num_args β€” number of arguments passed

This convenience routine is lowkey simple: it just takes the parameters you passed in and calls XtCreateWidget, then returns the widget it created. That's it. That's the whole thing. Slay ✨


XmExt18ListUnselectAllItems

void XmExt18ListUnselectAllItems( Widget w )
  • w β€” the extended list widget to be modified

Unselects all rows of the passed extended list widget and returns nothing. Clean slate energy 🧚


XmExt18ListUnselectItem

void XmExt18ListUnselectItem(Widget w, Xm18RowInfo *row_info)
  • w β€” extended list widget
  • row_info β€” pointer to the row which is to be unselected

Unselects the row designated by row_info of the passed extended list widget w. One row, one job, done πŸ’…


Copyright (c) 1992 by Integrated Computer Solutions, Inc.


and that's a wrap on this page bestie!! πŸŽ€ the source is XxExt18LIst(3x) (yes the capitalization is Like That, we don't question the ancestors) and it's dated way back in the day β€” genuinely vintage, an icon, a legend, periodt. go forth and select some rows πŸ’–βœ¨πŸ¦‹