XMSCALE(3)

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

πŸ’– XmScale β€” The Scale widget class πŸ’–

okay bestie, so this is XmScale, from the library call section of the manual (section 3, iykyk). it's a whole widget class and she is serving elongated-rectangle realness. let's get into it 🫢

✨ SYNOPSIS ✨

#include <Xm/Scale.h>

that's it. that's the whole vibe. one include and you're in πŸ’…


🌸 DESCRIPTION 🌸

so what is a Scale, like, for? basically an application uses Scale to indicate a value from within a range of values, and it also lets the user input or modify a value from that same range. it's giving two-way communication, no cap.

A Scale has an elongated rectangular region β€” lowkey similar to a ScrollBar. inside that region there's a slider, and the slider's position indicates the current value along the Scale. the user can also modify the Scale's value by moving the slider around inside the rectangular region. so it's interactive, it's tactile, it's the moment. ✨

A Scale can also include a label set that lives outside the Scale region. these labels can indicate the relative value at various positions along the scale. and where does this label get placed? that depends on the XmNlayoutDirection resource of the widget. so, you know, respect the layout direction, she's the boss of placement. πŸ’…

now here's a key distinction, bestie β€” a Scale can be either input/output or output only:

  • An input/output Scale's value can be set by the application and also modified by the user with the slider.
  • An output-only Scale is used strictly as an indicator of the current value of something, and it cannot be modified interactively by the user. she's just there to look pretty and report facts.

the resource that controls this is the Scale resource XmNeditable β€” it specifies whether the user can interactively modify the Scale's value.

okay and one more thing: the user can specify resources in a resource file for the automatically created gadget that contains the title of the Scale widget. the name of that gadget is Title. and β€” plot twist β€” the placement of the title also depends on the XmNlayoutDirection resource of the widget. and the direction of the title is based on the widget's layout direction. so yeah, layout direction is doing a lot of heavy lifting here. she ate. πŸ‘‘

also for the record:

  • Scale uses the XmQTspecifyRenderTable trait
  • Scale holds the XmQTtransfer trait

πŸ¦‹ Data Transfer Behavior πŸ¦‹

Scale supports dragging of the representation of the Scale value from the Scale β€” but only when the value is displayed and when the value of the XmNenableUnselectableDrag resource of XmDisplay is set to True. both conditions, bestie. it's giving conditional.

so as a source of data, Scale supports these targets and the associated conversions of data to these targets:

  • COMPOUND_TEXT β€” the widget transfers a string representation of XmNvalue as type COMPOUND_TEXT.
  • UTF8_STRING β€” the widget transfers a string representation of XmNvalue as type UTF8_STRING.
  • STRING β€” the widget transfers a string representation of XmNvalue as type STRING.
  • _MOTIF_CLIPBOARD_TARGETS β€” the widget transfers, as type ATOM, a list of the targets it supports for the CLIPBOARD selection. these include STRING, COMPOUND_TEXT and UTF8_STRING.
  • _MOTIF_EXPORT_TARGETS β€” the widget transfers, as type ATOM, a list of the targets to be used as the value of the DragContext's XmNexportTargets in a drag-and-drop transfer. these include STRING, COMPOUND_TEXT and UTF8_STRING.

and as a source of data, Scale also supports these standard Motif targets:

  • BACKGROUND β€” the widget transfers XmNbackground as type PIXEL.
  • CLASS β€” the widget finds the first shell in the widget hierarchy that has a WM_CLASS property 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 type WINDOW.
  • COLORMAP β€” the widget transfers XmNcolormap as type COLORMAP.
  • FOREGROUND β€” the widget transfers XmNforeground as type PIXEL.
  • NAME β€” the widget finds the first shell in the widget hierarchy that has a WM_NAME property and transfers the contents as text in the current locale.
  • TARGETS β€” the widget transfers, as type ATOM, a list of the targets it supports. these include the standard targets in this list. these also include STRING, COMPOUND_TEXT and UTF8_STRING.
  • TIMESTAMP β€” the widget transfers the timestamp used to acquire the selection as type INTEGER.
  • _MOTIF_RENDER_TABLE β€” the widget transfers XmNrenderTable if it exists, or else the default text render table, as type STRING.
  • _MOTIF_ENCODING_REGISTRY β€” the widget transfers its encoding registry as type STRING. the value is a list of NULL separated items in the form of tag encoding pairs. this target symbolizes the transfer target for the Motif Segment Encoding Registry. Widgets and applications can use this Registry to register text encoding formats for specified render table tags. Applications access this Registry by calling XmRegisterSegmentEncoding and XmMapSegmentEncoding.

🌈 Descendants 🌈

Scale automatically creates the descendants shown below. an application can use XtNameToWidget to gain access to the named descendant. and bonus β€” a user or an application can use the named descendant when specifying resource values. πŸŽ€

  • Scrollbar β€” class XmScrollBar, identity: scroll bar
  • Title β€” class XmLabelGadget, identity: title of scale

(yes those are the whole contents of that table, bestie, and no we are not skipping a single cell πŸ’–)


πŸ‘‘ Classes πŸ‘‘

Scale inherits behavior, resources, and traits from Core, Composite, Constraint, and XmManager classes. lineage? impeccable. 🧚

  • the class pointer is xmScaleWidgetClass
  • the class name is XmScale

⭐ 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). ok that part matters, don't skip it πŸ™ˆ

and the codes in the access column? they tell you what you're allowed to do with a given resource:

  • C β€” can be set at creation time
  • S β€” can be set by using XtSetValues
  • G β€” can be retrieved by using XtGetValues
  • N/A β€” not applicable
the actual resource table comes next, bestie β€” part 2 is where it's at, so don't go anywhere πŸ’œ

okay bestie, here's the full resource menu for XmScale β€” every knob, dial and little vibe it ships with πŸ’… it's giving very customizable, no cap:

  • XmNconvertCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNdecimalPoints β€” class XmCDecimalPoints, type short, default 0, access CSG
  • XmNdragCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNeditable β€” class XmCEditable, type Boolean, default True, access CSG
  • XmNfontList β€” class XmCFontList, type XmFontList, default dynamic, access CSG
  • XmNhighlightOnEnter β€” class XmCHighlightOnEnter, type Boolean, default False, access CSG
  • XmNhighlightThickness β€” class XmCHighlightThickness, type Dimension, default 2, access CSG
  • XmNmaximum β€” class XmCMaximum, type int, default 100, access CSG
  • XmNminimum β€” class XmCMinimum, type int, default 0, access CSG
  • XmNorientation β€” class XmCOrientation, type unsigned char, default XmVERTICAL, access CSG
  • XmNprocessingDirection β€” class XmCProcessingDirection, type unsigned char, default dynamic, access CSG
  • XmNscaleHeight β€” class XmCScaleHeight, type Dimension, default 0, access CSG
  • XmNscaleMultiple β€” class XmCScaleMultiple, type int, default dynamic, access CSG
  • XmNscaleWidth β€” class XmCScaleWidth, type Dimension, default 0, access CSG
  • XmNrenderTable β€” class XmCRenderTable, type XmRenderTable, default dynamic, access CSG
  • XmNshowArrows β€” class XmCShowArrows, type XtEnum, default XmNONE, access CSG
  • XmNshowValue β€” class XmCShowValue, type XtEnum, default XmNONE, access CSG
  • XmNsliderMark β€” class XmCSliderMark, type XtEnum, default dynamic, access CSG
  • XmNsliderVisual β€” class XmCSliderVisual, type XtEnum, default dynamic, access CSG
  • XmNslidingMode β€” class XmCSlidingMode, type XtEnum, default XmSLIDER, access CSG
  • XmNtitleString β€” class XmCTitleString, type XmString, default NULL, access CSG
  • XmNvalue β€” class XmCValue, type int, default dynamic, access CSG
  • XmNvalueChangedCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C

✨ XmNconvertCallback ✨

the lil list of callbacks that fire when the Scale gets asked to convert a selection 🫢 the struct whose address gets yeeted into these callbacks is an XmConvertCallbackStruct. and the reason? XmCR_OK, obviously πŸ’–

πŸŽ€ XmNdecimalPoints πŸŽ€

how many decimal points to shift the slider value by when it's showing off on screen πŸ‘‘ like, say your slider value is 2,350 and your XmdecimalPoints value is 2 β€” boom, you get a display value of 23.50. slay. but bestie listen: the value must not be negative πŸ™ˆ

πŸ”₯ XmNdragCallback πŸ”₯

the callback list that goes off when the slider position changes while the slider is actively being dragged 😭 reason sent by the callback is XmCR_DRAG. it's giving live updates, it's giving main character energy.

πŸ’… XmNeditable πŸ’…

tells you how the Scale scrollbar reacts to user input. it can be True or False, like this:

  • True β€” lets the scrollbar be sensitive to user input. this is the default value πŸ’–
  • False β€” makes the Scale scrollbar insensitive to user input. important: the visual is not greyed out. this value would mostly be used in XmTHERMOMETER mode 🌑️

also, when XmNeditable is used on a widget it sets the dropsite to XmDROP_SITE_ACTIVE ✨

πŸ¦‹ XmNfontList πŸ¦‹

the font list used for the title text string that XmNtitleString specifies, plus the label shown when XmNshowValue is True 🌸

heads up bestie: this font list is an obsolete structure. it's only still here for compatibility with earlier releases of Motif 🧚 see the XmNrenderTable resource instead β€” that's the new it-girl πŸ’œ
  • XmNhighlightOnEnter β€” decides whether that lil highlighting rectangle gets drawn the moment your cursor slides into the widget. πŸ¦‹
real talk: if the shell's focus policy is XmEXPLICIT, this resource is straight up ignored β€” the widget just highlights whenever it has the focus, and that's that. πŸ’…
  • shell's focus policy is XmPOINTER and this resource is True β†’ the highlighting rectangle is drawn when the cursor moves into the widget ✨
  • shell's focus policy is XmPOINTER and this resource is False β†’ the highlighting rectangle is not drawn when the cursor moves into the widget πŸ™ˆ

The default is False.

  • XmNhighlightThickness β€” sets the size of the slider's border drawing rectangle, the one used for enter window and traversal highlight drawing. πŸ“
  • XmNmaximum β€” the slider's maximum value. Heads up bestie, XmNmaximum must be greater than XmNminimum. No cap. πŸ”₯
  • XmNminimum β€” the slider's minimum value. And yeah, XmNmaximum must be greater than XmNminimum β€” that rule goes both ways. 🌸
  • XmNorientation β€” displays the Scale vertically or horizontally. This resource can have the values XmVERTICAL and XmHORIZONTAL. πŸŽ€
  • XmNprocessingDirection β€” tells you whether the value for XmNmaximum sits on the right or the left side of XmNminimum for horizontal Scales, or above or below XmNminimum for vertical Scales. The values it takes are XmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT, and XmMAX_ON_RIGHT.
    • if the Scale is oriented vertically, the default is XmMAX_ON_TOP ⬆️
    • if the XmScale is oriented horizontally, the default depends on the XmNlayoutDirection resource of the widget πŸ‘‘
  • XmNrenderTable β€” the render table to use for the title text string specified by XmNtitleString, and for the label displayed when XmNshowValue is True. πŸ’œ
    • if this value is NULL at initialization, the parent hierarchy gets searched for an ancestor that holds the XmQTspecifyRenderTable trait 🧚
    • if such an ancestor is found, the render table is initialized to the XmLABEL_RENDER_TABLE value of the ancestor widget ✨
    • if no such ancestor is found, the default is implementation dependent 🀷
    • if a font list (XmNfontList) and a render table are both specified, the render table takes precedence β€” it wins, periodt πŸ’…

Refer to XmRenderTable(3) for more info on the creation and structure of a render table.

  • XmNscaleHeight β€” the height of the slider area. The value should be in the specified unit type (the default is pixels). If no value is specified, a default height is computed. πŸ“
  • XmNscaleMultiple β€” how far to move the slider when the user takes an action that moves the slider by a multiple increment. The default is (XmNmaximum - XmNminimum) divided by 10, with a minimum of 1. πŸ”’
  • XmNscaleWidth β€” the width of the slider area. Value goes in the specified unit type (default is pixels). If no value is specified, a default width is computed. πŸ“
  • XmNshowArrows β€” whether the arrows get displayed, and how. This resource can take these values:
    • XmEACH_SIDE β€” one arrow is displayed on each end of the ScrollBar slider β¬…οΈβž‘οΈ
    • XmMAX_SIDE β€” one arrow is displayed on the XmNmaximum side of the ScrollBar slider πŸ”₯
    • XmMIN_SIDE β€” one arrow is displayed on the XmNminimum side of the ScrollBar slider 🌱
    • XmNONE β€” no arrows are displayed at all πŸ™ˆ

XmNONE is the default value.

  • XmNshowValue β€” whether a label for the current slider value should be displayed next to the slider. πŸ‘€
    • value is XmNEAR_SLIDER β†’ the current slider value is displayed ✨
    • value is XmNONE β†’ no slider value is displayed πŸ’€
    • value is XmNEAR_BORDER β†’ the current slider value is displayed near the border πŸŽ€
  • XmNsliderMark β€” the shape the slider is displayed in. This resource can take these values:
    • XmETCHED_LINE β€” the slider as an etched line. This is the default when XmNslidingMode is XmSLIDER. ✏️
    • XmNONE β€” the slider as a foregrounded rectangle. This is the default when XmNslidingMode is XmTHERMOMETER and the Scale scrollbar is insensitive to user input (XmNeditable is False). πŸ”’
    • XmROUND_MARK β€” the slider as a shadowed circle. This is the default when XmNslidingMode is XmTHERMOMETER and the Scale scrollbar is sensitive to user input (XmNeditable is True). β­•
    • XmTHUMB_MARK β€” the slider as a series of three etched lines centered in the middle of the slider. 🫢
  • XmNslidingMode β€” the mode the slider works in. There are two possible modes:
    • XmSLIDER β€” lets the slider move freely between the minimum and maximum ends of the scale. This is the default value. πŸ›
    • XmTHERMOMETER β€” forces the slider to be anchored to one side of the trough area. 🌑️
  • XmNsliderVisual β€” the color of the slider visual. This resource can take these values:
    • XmBACKGROUND_COLOR β€” the slider visual is in the background color 🎨
    • XmFOREGROUND_COLOR β€” the slider visual is in the foreground color πŸ–ŒοΈ
    • XmSHADOWED_BACKGROUND β€” the slider visual is in the background color, with a shadow. This is the default when the XmNslidingModel resource is XmSLIDER. πŸŒ‘
    • XmTROUGH_COLOR β€” the slider visual is in the trough color. This is the default when the XmNslidingModel resource is XmTHERMOMETER. 🌈
  • XmNtitleString β€” the title text string that appears in the Scale widget window. πŸ‘‘
  • XmNvalue β€” the slider's current position along the scale, somewhere between XmNminimum and XmNmaximum. The value is constrained to stay within those inclusive bounds. The initial value of this resource is the larger of 0 (zero) and XmNminimum. ⭐
  • XmNvalueChangedCallback β€” the list of callbacks that gets called when the value of the slider has changed. The reason sent by the callback is XmCR_VALUE_CHANGED. πŸ””

🧬 Inherited Resources 🧬

Scale 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. πŸ’–

XmManager Resource Set πŸ‘‘

okay bestie, this is the whole XmManager resource set β€” every row, every value, no skips. Columns are name, class, type, default, and access. Let's go πŸ’–

  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG ✨
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG πŸ¦‹
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG 🌸
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C πŸ’…
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG πŸ”₯
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG 🌈
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default NULL, access CSG πŸŽ€
  • XmNlayoutDirection β€” class XmCLayoutDirection, type XmDirection, default dynamic, access CG πŸ’œ
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmTAB_GROUP, access CSG ⭐
  • XmNpopupHandlerCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C πŸ™ˆ
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 2, access CSG πŸ“
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDirection, default dynamic, access CG 🧚
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG πŸ’–
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG πŸ¦‹
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG πŸ‘‘
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG 🌸
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG πŸ’…

Composite Resource Set πŸ¦‹

and here's the Composite set, bestie β€” only three rows but they're iconic. same columns, same energy πŸ’–

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G ✨
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default NULL, access CSG 🌈
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G πŸ’œ

all three, no cap πŸ’–

  • XmNaccelerators πŸ’… β€” class XmCAccelerators, type XtAccelerators, default dynamic, access CSG
  • XmNancestorSensitive ✨ β€” class XmCSensitive, type Boolean, default dynamic, access G
  • XmNbackground πŸŽ€ β€” class XmCBackground, type Pixel, default dynamic, access CSG
  • XmNbackgroundPixmap πŸ–ΌοΈ β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderColor 🌈 β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG
  • XmNborderPixmap πŸ¦‹ β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG
  • XmNdestroyCallback πŸ’€ β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access C
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG
  • XmNscreen πŸ–₯️ β€” class XmCScreen, type Screen *, default dynamic, access CG
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default dynamic, access CSG
  • XmNwidth β€” class XmCWidth, type Dimension, default dynamic, access CSG
  • XmNx β€” class XmCPosition, type Position, default 0, access CSG
  • XmNy β€” class XmCPosition, type Position, default 0, access CSG

πŸŽ€ Callback Information πŸŽ€

Bestie, when a callback fires, it hands you a pointer to a struct, and the struct is not the same for every callback, so pay attention πŸ‘€

A pointer to the following structure is passed to the XmNdragCallback and XmNvalueChangedCallback procedures:

typedef struct
{
        int reason;
        XEvent * event;
        int value;
} XmScaleCallbackStruct;
  • reason β€” tells you why the callback got invoked πŸ’…
  • event β€” points to the XEvent that triggered the callback
  • value β€” is the new slider value ✨

A pointer to the following structure is passed to the XmNconvertCallback procedures:

typedef struct
{
        int reason;
        XEvent *event;
        Atom selection;
        Atom target;
        XtPointer source_data;
        XtPointer location_data;
        int flags;
        XtPointer parm;
        int parm_format;
        unsigned long parm_length;
        int status;
        XtPointer value;
        Atom type;
        int format;
        unsigned long length;
} XmConvertCallbackStruct;
  • reason β€” indicates why the callback was invoked.
  • event β€” points to the XEvent that triggered the callback. It can be NULL.
  • selection β€” indicates the selection for which conversion is being requested. Possible values are CLIPBOARD, PRIMARY, SECONDARY, and _MOTIF_DROP.
  • target β€” says what we're converting to, bestie. The conversion target. ✨
  • source_data β€” the tea on where the selection came from. When the selection is _MOTIF_DROP, source_data is the DragContext. Any other time? It's NULL. πŸ’…
  • location_data β€” the tea on where the data-to-be-converted lives. If this is NULL, then the data being transferred is just the widget's current selection, no cap. πŸ¦‹
  • flags β€” the status of the conversion, and here's the whole roster of possible values:
    • XmCONVERTING_NONE β€” this flag is currently unused. Just sitting there. Iconic but unemployed. πŸ’€
    • XmCONVERTING_PARTIAL β€” the target widget was able to be converted, but some data got lost along the way. 😭
    • XmCONVERTING_SAME β€” the conversion target is literally the source of the data being transferred. It's giving mirror. πŸͺž
    • XmCONVERTING_TRANSACT β€” also currently unused. Two for two on the unused flags, we love a chill flag. πŸŽ€
  • parm β€” holds parameter data for this target. If there's no parameter data, the value is NULL.

When the selection is CLIPBOARD and the target is _MOTIF_CLIPBOARD_TARGETS or _MOTIF_DEFERRED_CLIPBOARD_TARGETS, the value is the requested operation β€” and that's XmCOPY, XmMOVE, or XmLINK. Pick your fighter. πŸ‘‘

  • parm_format β€” tells you whether the data in parm should be viewed as a list of char, short, or long quantities. The possible values are 0 (when parm is NULL), 8 (when the data in parm should be viewed as a list of chars), 16 (when it should be viewed as a list of shorts), or 32 (when it should be viewed as a list of longs).
Heads up bestie, this one's a vibe check trap: parm_format symbolizes a data type, not the number of bits in each list element. For example, on some machines, a parm_format of 32 means the data in parm should be viewed as a list of 64-bit quantities, not 32-bit quantities. So do not assume, fr fr. πŸ’€
  • parm_length β€” the number of elements of data in parm, where each element has the size specified by parm_format. When parm is NULL, the value is 0.
  • status β€” an IN/OUT member that says how the conversion is going. The initial value is XmCONVERT_DEFAULT, and the callback procedure can set this member to one of these:
    • XmCONVERT_DEFAULT β€” means the widget class conversion procedure, if any, gets called after the callback procedures return. And if that widget class conversion procedure produces any data, it overwrites the data the callback procedures put in the value member. Rude but okay. πŸ’…
    • XmCONVERT_MERGE β€” means the widget class conversion procedure, if any, is called after the callback procedures return. If it produces any data, it appends its data to whatever the callback procedures provided in the value member. This value is intended for use with targets that result in lists of data, such as TARGETS. Slay, teamwork. 🫢
    • XmCONVERT_DONE β€” means the callback procedure has successfully finished the conversion. The widget class conversion procedure, if any, does not get called after the callback procedures return. She's done, she's leaving. ✨
    • XmCONVERT_REFUSE β€” means the callback procedure has terminated the conversion process without completing the requested conversion. The widget class conversion procedure, if any, is not called after the callback procedures return. Not me refusing. πŸ™ˆ
  • value β€” an IN/OUT parameter holding whatever data the callback procedure produces as a result of the conversion. The initial value is NULL. If the callback procedure sets this member, it must make sure the type, format, and length members correspond to the data in value. And listen: the callback procedure is responsible for allocating, but not for freeing, memory when it sets this member. Allocate, don't deallocate. Noted. πŸŽ€
  • type β€” an IN/OUT parameter indicating the type of the data in the value member. The initial value is INTEGER.
  • format β€” an IN/OUT parameter specifying whether the data in value should be viewed as a list of char, short, or long quantities. The initial value is 8. The callback procedure can set this member to 8 (for a list of char), 16 (for a list of short), or 32 (for a list of long). πŸ’–
  • length β€” an IN/OUT member specifying the number of elements of data in value, where each element has the size symbolized by format. The initial value is 0.

✨ Behavior ✨

XmScale has the following behavior, and honestly? It's a lot. Buckle up bestie. 🎒

  • <Btn1Down> or <Btn2Down>:
    • In the region between an end of the Scale and the slider: moves the slider by one multiple increment in the direction of the end of the Scale, and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_RIGHT or XmMAX_ON_BOTTOM, movement toward the right or bottom increments the Scale value, and movement toward the left or top decrements the Scale value. If XmNprocessingDirection is XmMAX_ON_LEFT or XmMAX_ON_TOP, movement toward the right or bottom decrements the Scale value, and movement toward the left or top increments the Scale value. And if the button is held down longer than a delay period, the slider is moved again by the same increment and the same callbacks are called. Hold to repeat, periodt. πŸ”
    • In slider: activates the interactive dragging of the slider. Grab and go. πŸ’…
  • <Btn2Down> in value label: drags the contents of the label showing the current slider value. This action sets the XmNconvertProc of the DragContext to a function that calls the XmNconvertCallback procedures β€” possibly multiple times β€” for the _MOTIF_DROP selection. πŸ¦‹
  • <Btn1Motion> or <Btn2Motion>: if the button press occurs within the slider, the subsequent motion events move the slider to the position of the pointer and call the callbacks for XmNdragCallback. 🫢
  • <Btn1Up> or <Btn2Up>: if the button press occurs within the slider and the slider position is changed, the callbacks for XmNvalueChangedCallback are called. Mission accomplished. ✨
  • <Ctrl><Btn1Down>:
    • In the region between an end of the Scale and the slider: moves the slider to that end of the Scale and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_RIGHT or XmMAX_ON_BOTTOM, movement toward the right or bottom increments the Scale value, and movement toward the left or top decrements the Scale value. If XmNprocessingDirection is XmMAX_ON_LEFT or XmMAX_ON_TOP, movement toward the right or bottom decrements the Scale value, and movement toward the left or top increments the Scale value. Straight to the end, no in-between. πŸ’€
  • <Key><osfUp>: for vertical Scales, moves the slider up one increment and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_TOP, movement toward the top increments the Scale value. If XmNprocessingDirection is XmMAX_ON_BOTTOM, movement toward the top decrements the Scale value. ⬆️
  • <Key><osfDown>: for vertical Scales, moves the slider down one increment and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_BOTTOM, movement toward the bottom increments the Scale value. If XmNprocessingDirection is XmMAX_ON_TOP, movement toward the bottom decrements the Scale value. ⬇️
  • <Key><osfLeft>: for horizontal Scales, moves the slider one increment to the left and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_LEFT, movement toward the left increments the Scale value. If XmNprocessingDirection is XmMAX_ON_RIGHT, movement toward the left decrements the Scale value. ⬅️
  • <Key><osfRight>: for horizontal Scales, moves the slider one increment to the right and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_RIGHT, movement toward the right increments the Scale value. If XmNprocessingDirection is XmMAX_ON_LEFT, movement toward the right decrements the Scale value. ➑️
  • <Ctrl><Key><osfUp> or <Key><osfPageUp>: for vertical Scales, moves the slider up one multiple increment and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_TOP, movement toward the top increments the Scale value. If XmNprocessingDirection is XmMAX_ON_BOTTOM, movement toward the top decrements the Scale value. πŸ”₯
  • <Ctrl><Key><osfDown> or <Key><osfPageDown>: for vertical Scales, moves the slider down one multiple increment and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_BOTTOM, movement toward the bottom increments the Scale value. If XmNprocessingDirection is XmMAX_ON_TOP, movement toward the bottom decrements the Scale value. πŸ”₯
  • <Ctrl><Key><osfLeft> or <Key><osfPageLeft>: for horizontal Scales, moves the slider one multiple increment to the left and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_LEFT, movement toward the left increments the Scale value. If XmNprocessingDirection is XmMAX_ON_RIGHT, movement toward the left decrements the Scale value. 🌈
  • <Ctrl><Key><osfRight> or <Key><osfPageRight>: for horizontal Scales, moves the slider one multiple increment to the right and calls the XmNvalueChangedCallback callbacks. If XmNprocessingDirection is XmMAX_ON_RIGHT, movement toward the right increments the Scale value. If XmNprocessingDirection is XmMAX_ON_LEFT, movement toward the right decrements the Scale value. 🌈
  • <Key><osfBeginLine> or <Key><osfBeginData> β€” yeets the slider alllll the way down to the minimum value and fires off the XmNvalueChangedCallback callbacks. ✨
  • <Key><osfEndLine> or <Key><osfEndData> β€” opposite energy, bestie: slides it to the maximum value and calls those XmNvalueChangedCallback callbacks. πŸ’…
  • <Key><osfNextField> β€” hops over to the first item in the next tab group. And if you're already chilling at the last entry in the tab group list? It wraps all the way back to the beginning of the tab group list. no cap, it just loops πŸŒ€
  • <Key><osfPrevField> β€” same thing but backwards, moving to the first item in the previous tab group. Hit the beginning of the tab group list and it wraps to the end of the tab group list instead. it's giving carousel 🎠
  • <Key><osfHelp> β€” calls the callbacks for XmNhelpCallback, but only if any actually exist. If this widget has no help callbacks, this action goes looking up the family tree and calls the help callbacks for the nearest ancestor that has them. it asks the parent, fr fr 🫢

🌈 Virtual Bindings 🌈

The bindings for virtual keys are vendor specific. That's it, that's the whole vibe β€” every vendor does their own thing. For the deets on bindings for virtual buttons and keys, go read VirtualBindings(3). πŸ‘‘


The whole friend group, in alphabetical order because we're classy like that:


and that's a wrap on the XmScale library call page bestie!! πŸ’– go forth and scale responsibly, you absolute icon, mwah πŸŽ€πŸ¦‹β­