DTSPINBOX(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸŽ€ NAME πŸŽ€

okay bestie, this is DtSpinBox(library call) β€” literally the SpinBox widget class πŸ’…βœ¨

✨ SYNOPSIS ✨

#include &<Dt/SpinBox.h>

πŸ’… DESCRIPTION πŸ’…

⚠️ Note: This widget has been superseded by the equivalent Motif widget XmSimpleSpinBox. Please refer to the Motif Programmer's Reference for more information.

The DtSpinBox widget is a user interface control that increments and decrements an arbitrary TextField β€” it’s giving β€œlittle spinny bestie for your values” πŸŒ€. For example, it can be used to cycle through the months of the year or days of the month. Iconic.

Widget subclassing is not supported for the DtSpinBox widget class. No cap, that’s just the rule 🫢.

πŸŽ€ Classes πŸŽ€

The DtSpinBox widget inherits behavior and resources from the Core, Composite and XmManager classes.

🫠 tiny original-text goblin preserved here: Caret1The class pointer is dtSpinBoxWidgetClass. So yes β€” the class pointer is dtSpinBoxWidgetClass.

The class name is DtSpinBoxWidget.

🧚 New Resources 🧚

The following set of widget resources is used by the application to specify data. The application 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, the application must remove the DtN or DtC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, the application must remove the Dt prefix and use the remaining letters (in either lower case or upper case, but including any underscores between words). Slay.

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).

🌈 DtSpinBox Resource Set 🌈

  • DtNarrowLayout β€” Class DtCArrowLayout; Type unsigned char; Default DtARROWS_END; Access CSG
  • DtNarrowSensitivity β€” Class DtCArrowSensitivity; Type unsigned char; Default DtARROWS-_SENSITIVE; Access CSG
  • DtNdecimalPoints β€” Class DtCDecimalPoints; Type short; Default 0; Access CSG
  • DtNincrementValue β€” Class DtCIncrementValue; Type int; Default 1; Access CSG
  • DtNinitialDelay β€” Class DtCInitialDelay; Type unsigned int; Default 250; Access CSG
  • DtNmaximumValue β€” Class DtCMaximumValue; Type int; Default 10; Access CSG
  • DtNminimumValue β€” Class DtCMinimumValue; Type int; Default 0; Access CSG
  • DtNmodifyVerifyCallback β€” Class DtCCallback; Type XtCallbackList; Default NULL; Access C
  • DtNnumValues β€” Class DtCNumValues; Type int; Default 0; Access CSG
  • DtNposition β€” Class DtCPosition; Type int; Default 0; Access CSG
  • DtNrepeatDelay β€” Class DtCRepeatDelay; Type unsigned int; Default 200; Access CSG
  • DtNspinBoxChildType β€” Class DtCSpinBoxChildType; Type unsigned char; Default XmSTRING; Access CG
  • DtNvalueChangedCallback β€” Class DtCCallback; Type XtCallbackList; Default NULL; Access C
  • DtNvalues β€” Class DtCValues; Type XmStringTable; Default NULL; Access CSG
🧚 little layout artifact from the original, kept exactly because detail gremlins are valid: tgroup dispwid="8.51in"

πŸŒ€ DtNarrowLayout

Specifies the style and position of the SpinBox arrows. These values are supported:

  • DtARROWS_FLAT_BEGINNING β€” The arrows are placed side by side to the right of the TextField.
  • DtARROWS_FLAT_END β€” The arrows are placed side by side to the left of the TextField.
  • DtARROWS_SPLIT β€” The down arrow is on the left and the up arrow is on the right of the TextField.
  • DtARROWS_BEGINNING β€” The arrows are stacked and placed on the left of the TextField.
  • DtARROWS_END β€” The arrows are stacked and placed on the right of the TextField.

🌸 DtNarrowSensitivity

Specifies the sensitivity of the arrows in the DtSpinBox. These values are supported:

  • DtARROWS_SENSITIVE β€” Both arrows are active to user selection.
  • DtARROWS_DECREMENT_SENSITIVE β€” The down arrow is active and the up arrow is inactive to user selection.
  • DtARROWS_INCREMENT_SENSITIVE β€” The up arrow is active and the down arrow is inactive to user selection.
  • DtARROWS_INSENSITIVE β€” Both arrows are inactive to user selection.

πŸ’œ DtNdecimalPoints

Specifies the position of the radix character within the numeric value when DtNspinBoxChildType is DtNUMERIC. This resource is used to allow for floating point values in the DtSpinBox widget ✨.

πŸ”₯ DtNincrementValue

Specifies the amount to increment or decrement the DtNposition when the DtNspinBoxChildType is DtNUMERIC. When the Up action is activated, the DtNincrementValue is added to the DtNposition value; when the Down action is activated, the DtNincrementValue is subtracted from the DtNposition value. When DtNspinBoxChildType is DtSTRING, this resource is ignored.

πŸ¦‹ DtNinitialDelay

Specifies the amount of time in milliseconds before the Arrow buttons will begin to spin continuously. Tiny pause, then chaos πŸ’«.

πŸ“ DtNnumValues

Specifies the number of items in the DtNvalues list when the DtNspinBoxChildType resource is DtSTRING. The value of this resource must be a positive integer. The DtNnumValues is maintained by the DtSpinBox widget when items are added or deleted from the DtNvalues list. When DtNspinBoxChildType is not DtSTRING, this resource is ignored.

🌈 DtNvalues

Supplies the list of strings to cycle through when the DtNspinButtonChildType resource is DtSTRING. When DtNspinBoxChildType is not DtSTRING, this resource is ignored. Yes, DtNspinButtonChildType is exactly what the original says β€” copy-paste goblin behavior, preserved πŸ‘‘.

⭐ DtNmaximumValue

Specifies the upper bound on the DtSpinBox's range when DtNspinBoxChildType is DtNUMERIC.

πŸŽ€ DtNminimumValue

Specifies the lower bound on the DtSpinBox's range when DtNspinBoxChildType is DtNUMERIC.

🫢 DtNmodifyVerifyCallback

Specifies the callback to be invoked just before the DtSpinBox position changes. The application can use this callback to implement new application-related logic (including setting new position spinning to, or canceling the impending action). For example, this callback can be used to stop the spinning just before wrapping at the upper and lower position boundaries. If the application sets the doit member of the DtSpinBoxCallbackStruct to False, nothing happens. Otherwise, the position changes. Reasons sent by the callback are DtCR_SPIN_NEXT, or DtCR_SPIN_PRIOR.

πŸ’« DtNposition

The DtNposition resource has a different value based on the DtNspinBoxChildType resource. When DtNspinBoxChildType is DtSTRING, the DtNposition is the index into the DtNvalues list for the current item. When the DtNspinBoxChildType resource is DtNUMERIC, the DtNposition is the integer value of the DtSpinBox that falls within the range of DtNmaximumValue and DtNminimumValue.

🧚 DtNrepeatDelay

Specifies the number of milliseconds between repeated calls to the DtNvalueChangedCallback while the user is spinning the DtSpinBox. Spin spin spin, but make it timed πŸ’….

🌟 DtNspinBoxChildType

Specifies the style of the DtSpinBox. These values are supported:

  • DtSTRING β€” The child is a string value that is specified through the DtNvalues resource and incremented and decremented by changing the DtNposition resource.
  • DtNUMERIC β€” The child is a numeric value that is specified through the DtNposition resource and incremented according to the DtNincrementValue resource.

πŸ’– DtNvalueChangedCallback

Specifies the callback to be invoked whenever the value of the DtNposition resource is changed through the use of the spinner arrows. The DtNvalueChangedCallback passes the DtSpinBoxCallbackStruct call_data structure.

πŸ’– Inherited Resources πŸ’–

Okay so the DtSpinBox widget literally inherits behavior and resources from these named superclasses β€” the whole family tree. For a complete description of each resource, see the man page for that superclass. 🫢

Each row below is Name / Class / Type / Default / Access.

🫢 XmManager Resource Set

  • 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.
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default dynamic, access CSG.
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default dynamic, 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 dynamic, access CSG.
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG.
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG.

🧚 Composite Resource Set

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G.
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default default procedure, access CSG.
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G.

πŸ‘‘ Core Resource Set

  • 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 😭

A pointer to the following structure is passed to each DtSpinBox callback:

typedef struct {
        int             reason;
        XEvent          *event;
        Widget          widget;
        Boolean         doit;
        int             position;
        XmString        value;
        Boolean         crossed_boundary;
} DtSpinBoxCallbackStruct;
  • reason β€” tells you why the callback was invoked, bestie. There are three possible reasons for this callback to be issued. The reason is DtCR_OK when this is the first call to the callback at the beginning of a spin or if it is a single activation of the spin arrows. If the DtSpinBox is in the process of being continuously spun, then the reason will be DtCR_SPIN_NEXT or DtCR_SPIN_PRIOR, depending on the arrow that is spinning. ⭐
  • event β€” points to the XEvent that triggered the callback. It can be NULL when the DtSpinBox is continuously spinning. πŸŒ€
  • widget β€” the widget identifier for the text widget that has been affected by the spin. 🫢
  • doit β€” set only when the call_data comes from the DtNmodifyVerifyCallback. It indicates that the action that caused the callback to be called should be performed. The action is not performed if doit is set to False. πŸ’…
  • position β€” the new value of the DtNposition resource as a result of the spin. ✨
  • value β€” the new XmString value displayed in the Text widget as a result of the spin. The application must copy this string if it is used beyond the scope of the call_data structure. πŸ“Ž
  • crossed_boundary β€” True when the spinbox cycles. This is the case when a DtNspinBoxChildType of DtSTRING wraps from the first item to the last or the last item to the first. In the case of the DtNspinBoxChildType of DtNUMERIC, the boundary is crossed when the DtSpinBox cycles from the maximum value to the minimum or vice versa. πŸŽ€

πŸ¦‹ SEE ALSO πŸ¦‹

Go bother these pages too, bestie β€” the whole squad is here:


That’s the whole page, bestie! Source/version footer: DtSpinBox(library call) β€” no date line was shown, so we’re not inventing one. Periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from