![]() | ActiveTcl User Guide | ![]() |
iwidgets::spinner - Create and manipulate a spinner widget
iwidgets::spinner pathName ?options?
itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Spinner
background borderWidth cursor exportSelection
options.
options.
childSitePos command fixed focusCommand
inherited options.
above inherited options.
repeat action on the arrow buttons engages. The default is 300
milliseconds.
the arrow buttons. A repeatinterval of 0 disables button repeat.
_________________________________________________________________
spinner is comprised of an entryfield plus up and down arrow but- tons. Arrows may be drawn horizontally or vertically.
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 ...?
delete get icursor index insert scan selection xview
ods.
childsite clear peek
methods.
pathName cget option
option. Option may have any of the values accepted by the iwid-
gets::spinner command.
pathName configure ?option? ?value option value ...?
option is specified, returns a list describing all of the avail-
able 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
ality.
pathName up
ality.
spinner. See the «canvas» widget manual entry for details on the
downarrow component item.
ner. See the «canvas» widget manual entry for details on the uparrow component item.
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}
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
10/18/95 - Added auto-repeat action to spinner arrow buttons.
spinner, widget