iwidgets::spinner(1)
π iwidgets::spinner(1) β bestie edition π
okay so you're reading iwidgets::spinner(1), straight outta [incr Widgets], and honestly? this one's a bop. it's the little spinny thing with the up and down arrows that goes brrr through your values. let's get into it π
β¨ NAME β¨
iwidgets::spinner β Create and manipulate a spinner widget. that's it, that's the whole job. iconic behavior honestly.
πΈ SYNOPSIS πΈ
iwidgets::spinner pathName ?options?
π¦ INHERITANCE π¦
the family tree goes like this, and yes it's giving royal lineage:
itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Spinner
so it inherits from itk::Widget, which inherits from iwidgets::Labeledwidget, which is the parent of iwidgets::Spinner. it's giving eldest daughter energy fr fr.
π STANDARD OPTIONS π
these come free with the widget, no cap:
backgroundborderWidthcursorexportSelectionforegroundhighlightColorhighlightThicknessinsertBackgroundinsertBorderWidthinsertOffTimeinsertOnTimeinsertWidthjustifyreliefselectBackgroundselectBorderWidthselectForegroundtextVariable
See the options manual entry for details on the standard options. iykyk π
π§ ASSOCIATED OPTIONS π§
showstate
See the entry manual entry for details on the associated options. π«Ά
π INHERITED OPTIONS π
from entryfield, lowkey a whole vibe:
childSitePoscommandfixedfocusCommandinvalidtextBackgroundtextFontvalidatewidth
See the entryfield widget manual entry for details on the above inherited options. π
and from labeledwidget, the whole other side of the family:
disabledForegroundlabelBitmaplabelFontlabelImagelabelMarginlabelPoslabelTextlabelVariablestatesticky
See the labeledwidget widget manual entry for details on the above inherited options. β¨
π WIDGET-SPECIFIC OPTIONS π
these are hers. main character options only.
arrowOrient β Class: Orient β Switch: -arroworient
Specifies placement of arrow buttons: horizontal or vertical. the default is vertical.
decrement β Class: Command β Switch: -decrement
Tcl command to be executed when the down arrow is pressed. β¬οΈ
increment β Class: Command β Switch: -increment
Tcl command to be executed when the up arrow is pressed. β¬οΈ
repeatDelay β Class: RepeatDelay β Switch: -repeatdelay
Specifies the initial delay in milliseconds before the spinner repeat action on the arrow buttons engages. the default is 300 milliseconds. so it waits a lil sec before it starts going feral π«
repeatInterval β Class: RepeatInterval β Switch: -repeatinterval
Specifies the repeat delay in milliseconds between selections of the arrow buttons. a repeatinterval of 0 disables button repeat. the default is 100 milliseconds.
π« DESCRIPTION π«
the iwidgets::spinner command creates a spinner widget. bestie, the spinner is comprised of an entryfield plus up and down arrow buttons. and the arrows may be drawn horizontally or vertically β your call, you're the one with the vision π
π₯ METHODS π₯
the iwidgets::spinner command creates a new Tcl command whose name is pathName. this command may be used to invoke various operations on the widget. it has the following general form:
pathName option ?arg arg ...?
option and the args determine the exact behavior of the command. the following commands are possible for spinner widgets:
π ASSOCIATED METHODS π
deletegeticursorindexinsertscanselectionxview
See the entry manual entry for details on the associated methods. π§
π INHERITED METHODS π
childsiteclearpeek
See the entryfield manual entry for details on the associated methods. πΈ
β WIDGET-SPECIFIC METHODS β
pathName cget option
Returns the current value of the configuration option given by option. option may have any of the values accepted by the iwidgets::spinner command.
pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. if no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). if option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). if one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. option may have any of the values accepted by the iwidgets::spinner command.
pathName down
Derived classes may overload this method to specialize functionality. β¬οΈ
pathName up
Derived classes may overload this method to specialize functionality. β¬οΈ
π«Ά COMPONENTS π«Ά
downarrow β Class: Canvas
The downarrow component is the downward pointing button of the spinner. See the canvas widget manual entry for details on the downarrow component item.
uparrow β Class: Canvas
The uparrow component is the upward pointing button of the spinner. See the canvas widget manual entry for details on the uparrow component item.
π EXAMPLE π
here's the whole thing in action, a month spinner, absolutely ate:
package require Iwidgets 4.0
set months {January February March April May June July \
August September October November December}
proc blockInput {char} {
return 0
}
proc spinMonth {step} {
global months
set index [expr [lsearch $months [.sm get]] + $step]
if {$index < 0} {set index 11}
if {$index > 11} {set index 0}
.sm delete 0 end
.sm insert 0 [lindex $months $index]
}
iwidgets::spinner .sm -labeltext "Month : " -width 10 -fixed 10 \
-validate blockInput -decrement {spinMonth -1} -increment {spinMonth 1}
.sm insert 0 January
pack .sm -padx 10 -pady 10
π ACKNOWLEDGEMENTS π
Ken Copeland <ken@hilco.com>
10/18/95β Added auto-repeat action to spinner arrow buttons. (the glow-up that made the arrows go brrr on their own, periodt π )
π AUTHOR π
Sue Yockey
π KEYWORDS π
spinnerwidget
and that's the whole page, bestie!! no notes, we ate π½οΈβ¨ this one ships as Tk β iwidgets::spinner(1) β so go forth, spin your months, block your input, and slay πππ¦
π¦ where this page comes from
- debian bookworm: iwidgets4-doc 4.1.1-2.1
- debian trixie: iwidgets4-doc 4.1.1-4
- ubuntu jammy: iwidgets4-doc 4.1.1-2.1
- ubuntu noble: iwidgets4-doc 4.1.1-2.1
- ubuntu resolute: iwidgets4-doc 4.1.1-4
- ubuntu stonking: iwidgets4-doc 4.1.1-4
- Copyright (c) 1995 DSC Technologies Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms