DTSPINBOX(3)
π 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 isdtSpinBoxWidgetClass.
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β ClassDtCArrowLayout; Typeunsigned char; DefaultDtARROWS_END; AccessCSGDtNarrowSensitivityβ ClassDtCArrowSensitivity; Typeunsigned char; DefaultDtARROWS-_SENSITIVE; AccessCSGDtNdecimalPointsβ ClassDtCDecimalPoints; Typeshort; Default0; AccessCSGDtNincrementValueβ ClassDtCIncrementValue; Typeint; Default1; AccessCSGDtNinitialDelayβ ClassDtCInitialDelay; Typeunsigned int; Default250; AccessCSGDtNmaximumValueβ ClassDtCMaximumValue; Typeint; Default10; AccessCSGDtNminimumValueβ ClassDtCMinimumValue; Typeint; Default0; AccessCSGDtNmodifyVerifyCallbackβ ClassDtCCallback; TypeXtCallbackList; DefaultNULL; AccessCDtNnumValuesβ ClassDtCNumValues; Typeint; Default0; AccessCSGDtNpositionβ ClassDtCPosition; Typeint; Default0; AccessCSGDtNrepeatDelayβ ClassDtCRepeatDelay; Typeunsigned int; Default200; AccessCSGDtNspinBoxChildTypeβ ClassDtCSpinBoxChildType; Typeunsigned char; DefaultXmSTRING; AccessCGDtNvalueChangedCallbackβ ClassDtCCallback; TypeXtCallbackList; DefaultNULL; AccessCDtNvaluesβ ClassDtCValues; TypeXmStringTable; DefaultNULL; AccessCSG
π§ 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 theTextField.DtARROWS_FLAT_ENDβ The arrows are placed side by side to the left of theTextField.DtARROWS_SPLITβ The down arrow is on the left and the up arrow is on the right of theTextField.DtARROWS_BEGINNINGβ The arrows are stacked and placed on the left of theTextField.DtARROWS_ENDβ The arrows are stacked and placed on the right of theTextField.
πΈ 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 theDtNvaluesresource and incremented and decremented by changing theDtNpositionresource.DtNUMERICβ The child is a numeric value that is specified through theDtNpositionresource and incremented according to theDtNincrementValueresource.
π 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β 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, defaultNULL, accessCSG.XmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultdynamic, accessCSG.XmNshadowThicknessβ classXmCShadowThickness, typeDimension, defaultdynamic, accessCSG.XmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCG.XmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSG.XmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSG.XmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultdynamic, accessCSG.XmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSG.XmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG.
π§ Composite Resource Set
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessG.XmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultdefault procedure, accessCSG.XmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG.
π Core Resource Set
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSG.XmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessG.XmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSG.XmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSG.XmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSG.XmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSG.XmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCG.XmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCG.XmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC.XmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSG.XmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessC.XmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSG.XmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCG.XmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSG.XmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSG.XmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSG.XmNxβ classXmCPosition, typePosition, default0, accessCSG.XmNyβ classXmCPosition, typePosition, default0, accessCSG.
π 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 isDtCR_OKwhen 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 theDtSpinBoxis in the process of being continuously spun, then the reason will beDtCR_SPIN_NEXTorDtCR_SPIN_PRIOR, depending on the arrow that is spinning. βeventβ points to theXEventthat triggered the callback. It can beNULLwhen theDtSpinBoxis continuously spinning. πwidgetβ the widget identifier for the text widget that has been affected by the spin. π«Άdoitβ set only when thecall_datacomes from theDtNmodifyVerifyCallback. It indicates that the action that caused the callback to be called should be performed. The action is not performed ifdoitis set toFalse. πpositionβ the new value of theDtNpositionresource as a result of the spin. β¨valueβ the newXmStringvalue 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 thecall_datastructure. πcrossed_boundaryβTruewhen the spinbox cycles. This is the case when aDtNspinBoxChildTypeofDtSTRINGwraps from the first item to the last or the last item to the first. In the case of theDtNspinBoxChildTypeofDtNUMERIC, the boundary is crossed when theDtSpinBoxcycles from the maximum value to the minimum or vice versa. π
π¦ SEE ALSO π¦
Go bother these pages too, bestie β the whole squad is here:
DtCreateSpinBox(3)DtSpinBoxAddItem(3)DtSpinBoxDeletePos(3)DtSpinBoxSetItem(3)Composite(3)Core(3)XmManager(3)XmText(3)XmTextField(3)XtGetValues(3)XtSetValues(3)
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
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms