XMSPINBOX(3)
π XmSpinBox π
okay so bestie, we're reading the manual page for XmSpinBox, and it lives in the library call section of the docs. sit down, grab a snack, this one's a whole journey π«Ά
π NAME π
XmSpinBox β the SpinBox widget class β¨
πΈ SYNOPSIS πΈ
#include <Xm/SpinB.h>
π¦ DESCRIPTION π¦
So what even is a SpinBox? SpinBox lets the user pick a value out of a ring of related but mutually exclusive choices, and it shows them one after another β like a little carousel of options π . Every SpinBox always has an increment arrow, a decrement arrow, and one or more other children. The choices get displayed one at a time inside a traversable text child (that's XmText or XmTextField). The user clicks <Btn1> on an arrow to show the next (or the previous) item in the ring. And if they press and hold <Btn1> on an arrow? It just keeps cycling through the choices, over and over, no cap π.
The traversable children in a SpinBox can be of type XmNUMERIC or XmSTRING, as defined by the XmNspinBoxChildType constraint resource. And here's how each one's ring of choices gets built:
- For numeric children, the ring is defined by minimum, maximum, incremental, and decimal point values.
- For string children, the ring is defined by an array of compound strings.
The application programmer can put multiple traversable children in the SpinBox. Like, for example, a SpinBox might be a pair of arrows plus month, day, and year text fields πβοΈπ . The arrows only spin the child that currently has focus β they're loyal like that π .
Arrow size is specified by the SpinBox resource XmNarrowSize. That value sets both the width and the height of each arrow, in pixels.
The programmer can display SpinBox arrows in one of several layouts, as specified by the XmNarrowLayout resource:
XmARROWS_BEGINNINGβ places a pair of left and right arrows before the children.XmARROWS_ENDβ places a pair of left and right arrows after the children.XmARROWS_SPLITβ places one arrow on each side of the children.XmARROWS_FLAT_BEGINNINGβ places a pair of arrows side by side before theXmSpinBoxchildren.XmARROWS_FLAT_BEGINNINGβ places a pair of arrows side by side after theXmSpinBoxchildren.
bestie I'm just gonna say it: yes, that last one is written as XmARROWS_FLAT_BEGINNING twice in the original. I am not about to go editing the source material π that's exactly what the page says.
Positions for XmARROWS_BEGINNING and XmARROWS_END are dependent on the VendorShell resource XmNlayoutDirection. When layout direction is left-to-right, beginning arrows are positioned to the left of the children. When layout direction is right-to-left, beginning arrows are positioned to the right.
The actions of the arrows are also determined by the VendorShell resource XmNlayoutDirection:
- For left-to-right layouts, the right arrow is the increment arrow and the left arrow is the decrement arrow.
- For right-to-left layouts, the right arrow is the decrement arrow and the left arrow is the increment arrow.
For a numeric type child, the increment arrow increases the displayed value by the incremental value, up to the maximum. The decrement arrow decreases the displayed value by the given incremental value, down to the minimum. ββ
The increment arrow for a string type child moves toward the last entry of the array of compound strings (by increasing the SpinBox constraint resource XmNposition). The decrement arrow moves toward the first entry of the compound string array.
The programmer can also control the sensitivity of each arrow in the SpinBox. Sensitive arrows spin choices; insensitive arrows do not spin choices. Arrow sensitivity is set for the SpinBox widget by using the XmNdefaultArrowSensitivity resource, but it can be modified on a per-child basis by using the XmNarrowSensitivity constraint resource. Slay, options β¨
SpinBox provides two callbacks to application programmers. (Also, the callbacks of the SpinBox's children may be invoked β don't forget them!) Each of these callbacks receives a pointer to XmSpinBoxCallbackStruct:
- The
XmNmodifyVerifyCallbackprocedures are called before a new choice is displayed. - The
XmNvalueChangedCallbackprocedures are called after a new choice is displayed.
XmNmodifyVerifyCallback tells the application what the new position will be in the ring of choices. This callback can be used to make the SpinBox stop at the upper and lower limits, or to jump to a different, nonconsecutive choice. The application allows the change in position by leaving the doit member set to True. The application can spin to a position other than the next consecutive position by leaving doit set to True and by changing the position member to the desired position. And when doit is set to False by an application, there is no change in the choice displayed.
After a new choice is displayed, the XmNvalueChangedCallback procedure is called. The application can use this procedure to do tasks when specific values are reached or when boundaries are crossed. For example, if the user spins from January back to December, the application could change to the previous year. If the user spins from December to January, the application could change to the next year. ποΈ iconic behavior honestly
SpinBox dimensions can be set using the Core resources XmNheight and XmNwidth. If dimensions are not specified, the SpinBox size is determined by the sizes of its arrows and children. The SpinBox will attempt to grow so that the arrows and all children are visible. it's giving main character energy, it wants everyone on screen π
SpinBox uses the XmQTaccessTextual trait and holds the XmQTnavigator trait.
π Classes π
SpinBox inherits behavior, resources, and traits from the Core, Composite, Constraint, and XmManager classes.
- The class pointer is
xmSpinBoxWidgetClass. - The class name is
XmSpinBox.
π 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 whether 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).
XmSpinBox Resource Set π
XmNarrowLayoutβ classXmCArrowLayout, typeunsigned char, defaultXmARROWS_BEGINNING, accessCSGXmNarrowOrientationβ classXmCArrowOrientation, typeunsigned char, defaultXmARROWS_VERTICAL, accessCSGXmNarrowSizeβ classXmCArrowSize, typeDimension, default16, accessCSGXmNdefaultArrowSensitivityβ classXmCDefaultArrowSensitivity, typeunsigned char, defaultXmARROWS_SENSITIVE, accessCSGXmNdetailShadowThicknessβ classXmCDetailShadowThickness, typeDimension, default2, accessCSGXmNinitialDelayβ classXmCInitialDelay, typeunsigned int, default250 ms, accessCSGXmNmarginHeightβ classXmCMarginHeight, typeDimension, defaultdynamic, accessCSGXmNmarginWidthβ classXmCMarginWidth, typeDimension, defaultdynamic, accessCSGXmNmodifyVerifyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNrepeatDelayβ classXmCRepeatDelay, typeunsigned int, default200 ms, accessCSGXmNspacingβ classXmCSpacing, typeDimension, defaultdynamic, accessCSGXmNvalueChangedCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC
XmNarrowLayout
Specifies placement of the two arrows in the widget. Possible layouts are as follows:
XmARROWS_BEGINNINGβ places left and right arrows beside each other, before the child(ren). Positioning for this layout is dependent on theVendorShellresourceXmNlayoutDirection.XmARROWS_ENDβ places left and right arrows beside each other, after the child(ren). Positioning for this layout is dependent on theVendorShellresourceXmNlayoutDirection.XmARROWS_FLAT_BEGINNINGβ places a pair of arrows side by side before theXmSpinBoxchildren. Positioning for this layout is dependent on theVendorShellresourceXmNlayoutDirection.XmARROWS_FLAT_ENDβ places a pair of arrows side by side after theXmSpinBoxchildren. Positioning for this layout is dependent on theVendorShellresourceXmNlayoutDirection.XmARROWS_SPLITβ places a left arrow on the left side and a right arrow on the right side of the child(ren).
XmNarrowSize
Specifies both the width and height of the arrow in pixels. π
XmNdefaultArrowSensitivity
Specifies the default sensitivity of the arrows in the widget. Insensitive arrows change color, cannot be depressed, and perform no action. (This resource may be overridden by the constraint resource XmNarrowSensitivity for individual traversable text children of the SpinBox.) Possible default sensitivity values are as follows:
XmARROWS_SENSITIVEβ both arrows are sensitive.XmARROWS_DECREMENT_SENSITIVEβ only the decrement arrow (as determined byXmNlayoutDirection) is sensitive. The increment arrow is insensitive.XmARROWS_INCREMENT_SENSITIVEβ only the increment arrow (as determined byXmNlayoutDirection) is sensitive. The decrement arrow is insensitive.XmARROWS_INSENSITIVEβ both arrows are insensitive.
XmNdetailShadowThickness
Specifies the thickness of the inside arrow shadows. The default thickness is 2 pixels.
XmNinitialDelay
Specifies how long, in milliseconds, the mouse button must be held down before automatic spinning begins. In other words, when the user selects the increment or decrement arrow and keeps it depressed, this delay occurs before the choices start spinning. If XmNinitialDelay is 0, then XmNrepeatDelay is used as the initial delay. β³
XmNmarginHeight
Specifies the amount of blank space between the top edge of the SpinBox widget and the first item in each column, and the bottom edge of the SpinBox widget and the last item in each column.
XmNmarginWidthβ how much blank space sits between the left edge of the SpinBox widget and the first item in each row, and between the right edge and the last item in each row. It's giving breathing room π¨XmNmodifyVerifyCallbackβ okay so this one fires before the SpinBox position actually changes (peep the Constraint resourceXmNposition). Your app can use it to set the next position, change SpinBox resources, or straight up cancel the impending action. Like, you could use it to stop the spinning right before it wraps at the upper and lower position boundaries. If thedoitmember is set toFalse, nothing happens β nada. Otherwise the position changes. The reasons this callback sends areXmCR_SPIN_NEXT,XmCR_SPIN_PRIOR,XmCR_SPIN_FIRST, orXmCR_SPIN_LAST.XmNrepeatDelayβ when the user selects an arrow button and keeps it depressed by pressing and holding<Btn1>, the spinning begins. After the time specified inXmNinitialDelayelapses, the SpinBox position changes automatically until the arrow button is released. This resource specifies the delay in milliseconds between each automatic change. And heads up: ifXmNrepeatDelayis set to0(zero), automatic spinning is turned off andXmNinitialDelayis just ignored. periodt πXmNspacingβ the horizontal and vertical spacing between items contained within the SpinBox widget.XmNvalueChangedCallbackβ this one gets called n+1 times for n SpinBox position changes (again, see the Constraint resourceXmNposition). The reasons it sends areXmCR_OK,XmCR_SPIN_NEXT,XmCR_SPIN_PRIOR,XmCR_SPIN_FIRST, orXmCR_SPIN_LAST. The other members are detailed in the callback structure description, iykyk.
π XmSpinBox Constraint Resource Set π
Every child of the SpinBox gets these. Buckle up bestie, here's the whole lineup π
XmNarrowSensitivityβ Class:XmCArrowSensitivity, Type:unsigned char, Default:XmARROWS_DEFAULT_SENSITIVITY, Access:CSGXmNdecimalPointsβ Class:XmCDecimalPoints, Type:short, Default:0, Access:CSGXmNincrementValueβ Class:XmCIncrementValue, Type:int, Default:1, Access:CSGXmNmaximumValueβ Class:XmCMaximumValue, Type:int, Default:10, Access:CSGXmNminimumValueβ Class:XmCMinimumValue, Type:int, Default:0, Access:CSGXmNnumValuesβ Class:XmCNumValues, Type:int, Default:0, Access:CSGXmNpositionβ Class:XmCPosition, Type:int, Default:0, Access:CSGXmNpositionTypeβ Class:XmCPositionType, Type:char, Default:XmPOSITION_VALUE, Access:CGXmNspinBoxChildTypeβ Class:XmSpinBoxChildType, Type:unsigned char, Default:XmSTRING, Access:CGXmNvaluesβ Class:XmCValues, Type:XmStringTable, Default:NULL, Access:CSG
β¨ The constraint resources, explained β¨
XmNarrowSensitivityβ says how sensitive the arrows are for a SpinBox child. By using this resource in the definition of a SpinBox child, the application programmer can override the default SpinBox sensitivity (which is set byXmNdefaultArrowSensitivity) for one particular child. That means every traversable child can have its own β¨uniqueβ¨ arrow sensitivity. The arrow sensitivity values are:XmARROWS_SENSITIVEβ both arrows are sensitive.XmARROWS_DECREMENT_SENSITIVEβ only the decrement arrow (as determined byXmNlayoutDirection) is sensitive.XmARROWS_INCREMENT_SENSITIVEβ only the increment arrow (as determined byXmNlayoutDirection) is sensitive.XmARROWS_INSENSITIVEβ both arrows are insensitive. RIP to them πͺ¦XmARROWS_DEFAULT_SENSITIVITYβ use the sensitivity specified in theXmNdefaultArrowSensitivityresource.
XmNdecimalPointsβ how many decimal places get used when displaying the value of a SpinBox numeric type child. If the number of decimal places you specify is greater than the number of digits in a displayed value, the value gets padded with0(zeros). For example, whenXmNinitialValueis1andXmNmaximumValueis1000andXmNdecimalPointsis3, the range of values displayed in the SpinBox is0.001to1.000. This is used only whenXmNspinBoxChildTypeisXmNUMERIC.XmNincrementValueβ the amount by which to increment or decrement a SpinBox numeric type child. Used only whenXmNspinBoxChildTypeisXmNUMERIC.XmNmaximumValueβ the highest possible value for a numeric SpinBox. Used only whenXmNspinBoxChildTypeisXmNUMERIC.XmNminimumValueβ the lowest possible value for a numeric SpinBox. Used only whenXmNspinBoxChildTypeisXmNUMERIC.XmNnumValuesβ the number of strings inXmNvalues. The application must change this value when strings are added to or removed fromXmNvalues. Used only whenXmNspinBoxChildTypeisXmSTRING.XmNpositionβ the position of the currently displayed item. How you readXmNpositiondepends entirely on the value of theXmNpositionTyperesource. Let's break it down π«Ά
When XmNpositionType is XmPOSITION_INDEX, the XmNposition value is interpreted like this:
- For
XmSpinBoxchildren of typeXmNUMERIC,XmNpositionis interpreted as an index into an array of items. The minimum allowable value forXmNpositionis0. The maximum allowable value forXmNpositionis(XmNmaximumValue-XmNminimumValue)/XmNincrementValue. The value displayed by theXmSpinBoxchild isXmNminimumValue+(XmNposition*XmNincrementValue). - For
XmSpinBoxchildren of typeXmSTRING,XmNpositionis interpreted as an index into an array ofXmNnumValuesitems. The minimum allowable value forXmNpositionis0. The maximum allowable value forXmNpositionisXmNnumValues - 1. The value displayed by theXmSpinBoxis theXmNposition'th value in theXmNvaluesarray.
When XmNpositionType is XmPOSITION_VALUE, the XmNposition value is interpreted like this:
- For
XmSpinBoxchildren of typeXmNUMERIC,XmNpositionis interpreted as the actual value to be displayed. The minimum allowable value forXmNpositionisXmNminimumValue. The maximum allowable value forXmNpositionisXmNmaximumValue. The value displayed by theXmSpinBoxchild isXmNposition. - For
XmSpinBoxchildren of typeXmSTRING, the interpretation is the same forXmPOSITION_VALUEas forXmPOSITION_INDEX.
Position values falling outside the specified range are invalid. When an application assigns a value toXmNpositionwhich is less than the minimum,XmNpositionis set to the minimum and an error message is displayed. When an application assigns a value toXmNpositionwhich is greater than the maximum,XmNpositionis set to the maximum and an error message is displayed. So like, the widget clamps you and then yells at you about it π
XmNpositionTypeβ specifies how values of theXmNpositionresource are to be interpreted. Valid values includeXmPOSITION_INDEXandXmPOSITION_VALUE.XmNspinBoxChildTypeβ the type of data displayed in the child:XmNUMERICβ the SpinBox choice range is defined by numeric minimum, maximum, and incremental values.XmSTRINGβ the SpinBox choices are alphanumeric.
XmNvaluesβ the array ofXmStrings to be displayed in a SpinBox string type child. The application must changeXmNnumValueswhen strings are added to or removed fromXmNvalues. Used only whenXmNspinBoxChildTypeisXmSTRING.
Inherited Resources π
okay bestie, so SpinBox doesn't just invent its whole personality from scratch β it inherits behavior and resources from its superclasses, and they're all listed in the tables below. for the full tea on each resource, go read the reference page for that superclass, mwah π
XmManager Resource Set β¨
XmNbottomShadowColorβ classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGXmNinitialFocusβ classXmCInitialFocus, typeWidget, defaultdynamic, accessCSGXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCGXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSGXmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default0, accessCSGXmNstringDirectionβ classXmCStringDirection, typeXmStringDirection, defaultdynamic, accessCGXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSGXmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG
Composite Resource Set π¦
XmNchildrenβ classXmCReadOnly, typeWidgetList, defaultNULL, accessGXmNinsertPositionβ classXmCInsertPosition, typeXtOrderProc, defaultNULL, accessCSGXmNnumChildrenβ classXmCReadOnly, typeCardinal, default0, accessG
Core Resource Set π
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGXmNancestorSensitiveβ 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
Callback π
A pointer to the following structure is passed to each callback:
typedef struct
{
int reason;
XEvent * event;
Widget widget;
Boolean doit;
int position;
XmString value;
Boolean crossed_boundary;
} XmSpinBoxCallbackStruct;
reasonβ tells you why the callback was invoked. reasons may be the following:XmCR_OKβ spinning has stopped because the SpinBox arrow has been disarmed.XmCR_OKis either the last or only call. πXmCR_SPIN_NEXTβ the increment arrow has been armed andpositionis increasing. further callbacks will come. for a numeric type child, the values displayed are approaching the maximum. for a string SpinBox, the values displayed are approaching the last entry in the array ofXmStrings. β¨XmCR_SPIN_PRIORβ the decrement arrow has been armed andpositionis decreasing. further callbacks will come. for a numeric type child, the values displayed are approaching the minimum. for a string type child, the values displayed are approaching the first entry in the array ofXmStrings. πΈXmCR_SPIN_FIRSTβ the begin data (<osfBeginData>) key sequence has been pressed. the SpinBox is at its first position, displaying the lowest value or the first entry in the array ofXmStrings. π«ΆXmCR_SPIN_LASTβ the end data (<osfEndData>) key sequence has been pressed. the SpinBox is at its last position, displaying the highest value or the last entry in the array ofXmStrings. π₯
eventβ points to theXEventthat triggered this callback.widgetβ specifies the child widget affected by this callback.doitβ when the callback isXmNmodifyVerifyCallback,doitindicates whether or not an action will be performed before the SpinBox position changes. if the callback leavesdoitset toTrue(the default), the spinning action is performed. if the callback setsdoittoFalse, the spinning action is not performed. when the callback isXmNvalueChangedCallback,doitis ignored.positionβ specifies the next value of the SpinBox position (same asXmNposition). this is an output field for theXmNmodifyVerifyCallback, which may change the next position as dictated by the needs of an application.valueβ specifies the newXmStringvalue in the text child widget. the user program must copy this string if it is to be used outside the callback routine.crossed_boundaryβ specifies whether or not the SpinBox has crossed the upper or lower boundary (the last or first compound string, or the maximum or minimum value). thecrossed_boundaryvalue isTrueif the SpinBox has just crossed a boundary, andFalseif it has not.
Translations π
The XmSpinBox translations are as follows:
The following key names are listed in the X standard key event translation table syntax. This format is the one used by Motif to specify the widget actions corresponding to a given key. A brief overview of the format is provided under VirtualBindings(3). For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation.
<Btn1Down>:
SpinBArm()
<Btn1Up>: SpinBDisarm()
:<Key><osfUp> :
SpinBPrior()
:<Key><osfDown> :
SpinBNext()
:<Key><osfLeft> :
SpinBLeft()
:<Key><osfRight> :
SpinBRight()
:<Key><osfBeginData> :
SpinBFirst()
:<Key><osfEndData> :
SpinBLast()
Accelerators π«
The XmNaccelerators resource of a SpinBox are added to each traversable text child. The default XmNaccelerators are defined in the following list. The bindings for <Key><osfUp> and <Key><osfDown> cannot be changed.
<Key> <osfUp>:
SpinBPrior()
<Key> <osfDown>:
SpinBNext()
<KeyUp> <osfUp>:
SpinBDisarm()
<KeyUp> <osfDown>:
SpinBDisarm()
<Key> <osfLeft>:
SpinBLeft()
<Key> <osfRight>:
SpinBRight()
<KeyUp> <osfLeft>:
SpinBDisarm()
<KeyUp> <osfRight>:
SpinBDisarm()
<Key> <osfBeginData>:
SpinBFirst()
<Key> <osfEndData>:
SpinBLast()
Action Routines π₯
The XmSpinBox action routines are as follows:
SpinBArm()β visually arms the SpinBox by drawing the armed arrow so that it appears to be depressed. this action is initiated when the user presses<Btn1>while the pointer is within the boundaries of either the increment or decrement arrow. the arrow remains visually armed as long as<Btn1>remains depressed. π
if the time period specified by XmNrepeatDelay is not greater than zero milliseconds, nothing else happens while <Btn1> remains depressed.
if the time period specified by XmNrepeatDelay is greater than zero milliseconds, and the arrow is disarmed before the time period specified by XmNinitialDelay has elapsed, nothing else happens in this action.
if the time period specified by XmNrepeatDelay is greater than zero milliseconds, and the arrow is still armed after the time period specified by XmNinitialDelay has elapsed, the following occurs:
- The
reasonmember of the SpinBox callback structure,XmSpinBoxCallbackStruct, is set toXmCR_SPIN_NEXTif the increment arrow is armed, or toXmCR_SPIN_PRIORif the decrement arrow is armed. - The
positionmember is set to the next position. - The
doitmember is set toTrue.
XmNmodifyVerifyCallback, if it exists, is invoked. The application may change the value ofpositionanddoit. If the application setsdoittoFalse, nothing else happens until theXmNrepeatDelayperiod has elapsed, or until<Btn1>is released.
If doit stays True (iconic behavior, we love to see it), here's the whole sequence:
- The value of
XmNpositionis changed to the value ofpositionin the SpinBox callback structure. - The text corresponding to the new position is displayed in the traversable text child that currently has focus.
- The
reasonmember of the SpinBox callback structure is set toXmCR_SPIN_NEXTif the increment arrow is armed, orXmCR_SPIN_PRIORif the decrement arrow is armed. - The
positionmember is set to the current (new) value ofXmNposition. XmNvalueChangedCallback, if it exists, is called. SpinBox ignores any changes topositionordoitmembers made byXmNvalueChangedCallback.
These events are repeated each time the XmNrepeatDelay period elapses and the arrow remains armed. π
SpinBDisarm() π
Visually disarms the SpinBox by drawing the previously armed arrow so that it no longer appears to be depressed. Un-pressing, if you will. π«Ά
If the time period specified by XmNrepeatDelay is not greater than zero milliseconds, or the time period specified by XmNinitialDelay has not elapsed, the following then occurs:
- The
reasonmember of the SpinBox callback structure,XmSpinBoxCallbackStruct, is set toXmCR_SPIN_NEXTif the increment arrow is armed, or toXmCR_SPIN_PRIORif the decrement arrow is armed. - The
positionmember is set to the next position. - The
doitmember is set toTrue. - The
XmNmodifyVerifyCallback, if there is one, is invoked. The application may change the value ofpositionanddoit. If the application setsdoittoFalse, nothing else happens until theXmNrepeatDelayperiod has elapsed, or until<Btn1>is released.
If doit remains set to True, the following occurs:
- The value of
XmNpositionis changed to the value ofpositionin the SpinBox callback structure. - The text corresponding to the new position is displayed in the traversable text child that currently has focus.
- The
reasonmember of the SpinBox callback structure is set toXmCR_SPIN_NEXTif the increment arrow is armed, orXmCR_SPIN_PRIORif the decrement arrow is armed. - The
positionmember is set to the current (new) value ofXmNposition. XmNvalueChangedCallback, if it exists, is called. SpinBox ignores any changes topositionordoitmembers made by anXmNvalueChangedCallback.
If an XmNvalueChangedCallback procedure is issued after the button has been armed, regardless of the value of XmNrepeatDelay or whether the XmNinitialDelay has expired:
- The
reasonmember of the SpinBox callback structure is set toXmCR_OK. - The
positionmember is set to the current value ofXmNposition. XmNvalueChangedCallback, if it exists, is called.
SpinBFirst() β
The following occurs:
- The
reasonmember of the SpinBox callback structure,XmSpinBoxCallbackStruct, is set toXmCR_SPIN_FIRST. - The
positionmember is set to the first (0) position. - The
doitmember is set toTrue. XmNmodifyVerifyCallback, if it exists, is invoked. The application may change the value ofpositionanddoit. If the application setsdoittoFalse, nothing else happens until theXmNrepeatDelayperiod has elapsed, or until<Btn1>is released.
If doit remains set to True, the following occurs:
- The value of
XmNpositionis changed to the value ofpositionin the SpinBox callback structure. - The text corresponding to the new position is displayed in the traversable text child that currently has focus.
- The
reasonmember of the SpinBox callback structure is set toXmCR_SPIN_FIRST. - The
positionmember is set to the current (new) value ofXmNposition. XmNvalueChangedCallback, if it exists, is called.- The
reasonmember of the SpinBox callback structure is set toXmCR_OK. - The
positionmember is set to the current (new)XmNpositionvalue. - The
XmNvalueChangedCallbackis called again. SpinBox ignores any changes topositionordoitmembers made byXmNvalueChangedCallback.
SpinBLast() πΈ
The following occurs:
- The
reasonmember of the SpinBox callback structure,XmSpinBoxCallbackStruct, is set toXmCR_SPIN_LAST. - The
positionmember is set to the last position. - The
doitmember is set toTrue. XmNmodifyVerifyCallback, if it exists, is invoked. The application may change the value ofpositionanddoit. If the application setsdoittoFalse, nothing else happens until theXmNrepeatDelayperiod has elapsed, or until<Btn1>is released.
If doit remains set to True, the following occurs:
- The value of
XmNpositionis changed to the value ofpositionin the SpinBox callback structure. - The text corresponding to the new position is displayed in the traversable text child that currently has focus.
- The
reasonmember of the SpinBox callback structure is set toXmCR_SPIN_LAST. - The
positionmember is set to the current (new) valueXmNposition. XmNvalueChangedCallback, if it exists, is called.- The
reasonmember of the SpinBox callback structure is set toXmCR_OK. - The
positionmember is set to the current (new) ofXmNposition. XmNvalueChangedCallbackis called again. SpinBox ignores any changes to thepositionordoitmembers made byXmNvalueChangedCallback.
SpinBLeft() π¦
If the VendorShell resource XmNlayoutDirection is left-to-right, the SpinBPrior action is invoked. Otherwise, the SpinBNext action is invoked.
SpinBNext() π₯
Visually arms the SpinBox by drawing the increment arrow so that it appears to be depressed. The following occurs:
- The
reasonmember of the SpinBox callback structure,XmSpinBoxCallbackStruct, is set toXmCR_SPIN_NEXT. - The
positionmember is set to the next position. - The
doitmember is set toTrue. XmNmodifyVerifyCallback, if it exists, is invoked. The application may change the value ofpositionanddoit. If the application setsdoittoFalse, nothing else happens until theXmNrepeatDelayperiod has elapsed, or until<Btn1>is released.
If doit remains set to True, the following occurs:
- The value of
XmNpositionis changed to the value ofpositionin the SpinBox callback structure. - The text corresponding to the new position is displayed in the traversable text child that currently has focus.
- The
reasonmember of the SpinBox callback structure is set toXmCR_SPIN_NEXT. - The
positionmember is set to the current (new) value ofXmNposition. XmNvalueChangedCallback, if it exists, is called.- The
reasonmember of the SpinBox callback structure is set toXmCR_OK. - The
positionmember is set to the current (new)XmNposition. - The
XmNvalueChangedCallbackis called again. SpinBox ignores any changes topositionordoitmembers made byXmNvalueChangedCallback.
SpinBPrior() π
Visually arms the SpinBox by drawing the decrement arrow so that it appears to be depressed. The following occurs:
- The
reasonmember of the SpinBox callback structure,XmSpinBoxCallbackStruct, is set toXmCR_SPIN_PRIOR. - The
positionmember is set to the next position. - The
doitmember is set toTrue. XmNmodifyVerifyCallback, if it exists, is invoked. The application may change the value ofpositionanddoit. If the application setsdoittoFalse, nothing else happens until theXmNrepeatDelayperiod has elapsed, or until<Btn1>is released.
If doit remains set to True, the following occurs:
- The value of
XmNpositionis changed to the value ofpositionin the SpinBox callback structure. - The text corresponding to the new position is displayed in the traversable text child that currently has focus.
- The
reasonmember of the SpinBox callback structure is set toXmCR_SPIN_PRIOR. - The
positionmember is set to the current (new) value ofXmNposition. XmNvalueChangedCallback, if it exists, is called.- The
reasonmember of the SpinBox callback structure is set toXmCR_OK. - The
positionmember is set to the current (new) value ofXmNposition. XmNvalueChangedCallbackis called again. SpinBox ignores any changes topositionordoitmembers made byXmNvalueChangedCallback.SpinBRight()β okay so this one's a lil choose-your-own-adventure π if theVendorShellresourceXmNlayoutDirectionis set to left-to-right, then theSpinBNextaction gets invoked. Otherwise? TheSpinBPrioraction gets invoked instead. That's it, that's the whole vibe β it just reads the layout direction and picks a lane. π
π¦ RELATED π¦
like bestie these are the siblings, the extended fam, the ones you also need to know about if you're gonna be messing with this π
Composite(3)Constraint(3)Core(3)XmCreateSpinBox(3)XmManager(3)XmString(3)XmVaCreateSpinBox(3)XmVaCreateManagedSpinBox(3)
and that's the whole page, no cap β¨ we did it β every last flag, action and cross-reference, all of it. go forth and spin those boxes, you absolute icon ππ
this has been XmSpinBox(library call) β iconic library-call energy, periodt π«ΆπΈ
π¦ 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