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:

  • background
  • borderWidth
  • cursor
  • exportSelection
  • foreground
  • highlightColor
  • highlightThickness
  • insertBackground
  • insertBorderWidth
  • insertOffTime
  • insertOnTime
  • insertWidth
  • justify
  • relief
  • selectBackground
  • selectBorderWidth
  • selectForeground
  • textVariable
See the options manual entry for details on the standard options. iykyk πŸ’œ

🧚 ASSOCIATED OPTIONS 🧚

  • show
  • state
See the entry manual entry for details on the associated options. 🫢

🌈 INHERITED OPTIONS 🌈

from entryfield, lowkey a whole vibe:

  • childSitePos
  • command
  • fixed
  • focusCommand
  • invalid
  • textBackground
  • textFont
  • validate
  • width
See the entryfield widget manual entry for details on the above inherited options. πŸ’–

and from labeledwidget, the whole other side of the family:

  • disabledForeground
  • labelBitmap
  • labelFont
  • labelImage
  • labelMargin
  • labelPos
  • labelText
  • labelVariable
  • state
  • sticky
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 πŸ“

  • delete
  • get
  • icursor
  • index
  • insert
  • scan
  • selection
  • xview
See the entry manual entry for details on the associated methods. 🧚

πŸ’œ INHERITED METHODS πŸ’œ

  • childsite
  • clear
  • peek
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 πŸŽ€

  • spinner
  • widget

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