NAME
iwidgets::spinner - Create and manipulate a spinner widget
SYNOPSIS
iiwwiiddggeettss::::ssppiinnnneerr pathName ?options? IINNHHEERRIITTAANNCCEEitk::Widget <- iwidgets::Labeledwidget <- iwidgets::Spinner
SSTTAANNDDAARRDD OOPPTTIIOONNSS bbaacckkggrroouunndd bboorrddeerrWWiiddtthh ccuurrssoorr eexxppoorrttSSeelleeccttiioonn ffoorreeggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss iinnsseerrttBBaacckkggrroouunndd iinnsseerrttBBoorrddeerrWWiiddtthh iinnsseerrttOOffffTTiimmee iinnsseerrttOOnnTTiimmee iinnsseerrttWWiiddtthh jjuussttiiffyy rreelliieeff sseelleeccttBBaacckkggrroouunndd sseelleeccttBBoorrddeerrWWiiddtthh sseelleeccttFFoorreeggrroouunndd tteexxttVVaarriiaabbllee See the "options" manual entry for details on the standard options. AASSSSOOCCIIAATTEEDD OOPPTTIIOONNSS sshhooww ssttaattee See the "entry" manual entry for details on the associated options. IINNHHEERRIITTEEDD OOPPTTIIOONNSS cchhiillddSSiitteePPooss ccoommmmaanndd ffiixxeedd ffooccuussCCoommmmaanndd iinnvvaalliidd tteexxttBBaacckkggrroouunndd tteexxttFFoonntt vvaalliiddaattee wwiiddtthh See the "entryfield" widget manual entry for details on the above inherited options. ddiissaabblleeddFFoorreeggrroouunndd llaabbeellBBiittmmaapp llaabbeellFFoonnttllaabbeellIImmaaggee llaabbeellMMaarrggiinn llaabbeellPPooss llaabbeellTTeexxtt llaabbeellVVaarriiaabbllee ssttaattee ssttiicckkyy See the "labeledwidget" widget manual entry for details on the above inherited options.WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS
Name: aarrrroowwOOrriieenntt Class: OOrriieennttCommand-Line Switch: -aarrrroowwoorriieenntt
Specifies placement of arrow buttons: hhoorriizzoonnttaall or vveerrttiiccaall. The default is vertical. Name: ddeeccrreemmeenntt Class: CCoommmmaannddCommand-Line Switch: -ddeeccrreemmeenntt
Tcl command to be executed when down arrow is pressed. Name: iinnccrreemmeenntt Class: CCoommmmaannddCommand-Line Switch: -iinnccrreemmeenntt
Tcl command to be executed when up arrow is pressed. Name: rreeppeeaattDDeellaayy Class: RReeppeeaattDDeellaayyCommand-Line Switch: -rreeppeeaattddeellaayy
Specifies the initial delay in milliseconds before the spinner repeat action on the arrow buttons engages. The default is 300 milliseconds. Name: rreeppeeaattIInntteerrvvaall Class: RReeppeeaattIInntteerrvvaallCommand-Line Switch: -rreeppeeaattiinntteerrvvaall
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 iiwwiiddggeettss::::ssppiinnnneerr command creates a spinner widget. The spinner is comprised of an entryfield plus up and down arrow buttons. Arrows may be drawn horizontally or vertically. MMEETTHHOODDSS The iiwwiiddggeettss::::ssppiinnnneerr 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: AASSSSOOCCIIAATTEEDD MMEETTHHOODDSS ddeelleettee ggeett iiccuurrssoorr iinnddeexx iinnsseerrtt ssccaann sseelleeccttiioonn xxvviieeww See the "entry" manual entry for details on the associated methods. IINNHHEERRIITTEEDD MMEETTHHOODDSS cchhiillddssiittee cclleeaarr ppeeeekkSee the "entryfield" manual entry for details on the associated meth-
ods.WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS
pathName ccggeett option Returns the current value of the configuration option given byoption. Option may have any of the values accepted by the iiwwiidd-
ggeettss::::ssppiinnnneerr command. pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If nooption is specified, returns a list describing all of the avail-
able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo 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 ormore 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 iiwwiiddggeettss::::ssppiinnnneerr command. pathName ddoowwnnDerived classes may overload this method to specialize function-
ality. pathName uuppDerived classes may overload this method to specialize function-
ality. CCOOMMPPOONNEENNTTSS Name: ddoowwnnaarrrrooww Class: CCaannvvaass The downarrow component is the downward pointing button of the spinner. See the "canvas" widget manual entry for details on the downarrow component item. Name: uuppaarrrrooww Class: CCaannvvaassThe uparrow component is the upward pointing button of the spin-
ner. See the "canvas" widget manual entry for details on the uparrow component item. EEXXAAMMPPLLEE 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 monthsset 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 Januarypack .sm -padx 10 -pady 10
AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS:: Ken Copeland10/18/95 - Added auto-repeat action to spinner arrow buttons.
AUTHOR Sue Yockey KKEEYYWWOORRDDSS spinner, widget Tk iwidgets::spinner(1)