spinner - Create and manipulate a spinner widget

SYNOPSIS

spinner pathName ?options?

INHERITANCE

itk::Widget <- Labeledwidget <- Spinner

STANDARD OPTIONS

background
foreground
insertBorderWidth
justify
selectForeground
borderWidth
highlightColor
insertOffTime
relief
textVariable
cursor
highlightThickness
insertOnTime
selectBackground
exportSelection
insertBackground
insertWidth
selectBorderWidth

See the "options" manual entry for details on the standard options.

ASSOCIATED OPTIONS

show
state

See the "entry" manual entry for details on the associated options.

INHERITED OPTIONS

childSitePos
invalid
width
command
textBackground
fixed
textFont
focusCommand
validate

See the "entryfield" widget manual entry for details on the above inherited options.

disabledForeground
labelMargin
state
labelBitmap
labelPos
labelFont
labelText
labelImage
labelVariable

See the "labeledwidget" widget manual entry for details on the above inherited options.

WIDGET-SPECIFIC OPTIONS

Name:                   arrowOrient
Class:                  Orient
Command-Line Switch:	-arroworient

Name:                   decrement
Class:                  Command
Command-Line Switch:	-decrement

Name:                   increment
Class:                  Command
Command-Line Switch:	-increment

Name:                   repeatDelay
Class:                  RepeatDelay
Command-Line Switch:	-repeatdelay

Name:                   repeatInterval
Class:                  RepeatInterval
Command-Line Switch:	-repeatinterval


DESCRIPTION

The spinner 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.

METHODS

The 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
insert
get
scan
icursor
selection
index
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 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 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

Name:                   downarrow
Class:                  Canvas

Name:                   uparrow
Class:                  Canvas

EXAMPLE

 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]
 }

 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>

AUTHOR

Sue Yockey

KEYWORDS

spinner, widget