1iwidgets::spinner  − Create and manipulate a spinner widget iwid‐

gets::spinner pathName ?options? itk::Widget <‐ iwidgets::La‐

3beledwidget <‐ iwidgets::Spinner

background borderWidth cursor exportSelection

foreground highlightColor highlightThickness insertBackground

insertBorderWidth insertOffTime insertOnTime insertWidth

justify relief selectBackground selectBorderWidth

selectForeground textVariable

9See  the  "options"  manual entry for details on the standard op‐
10tions.

show state

12See the "entry" manual entry for details on  the  associated  op‐
13tions.

childSitePos command fixed focusCommand

invalid textBackground textFont validate

width

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

disabledForeground labelBitmap labelFontlabelImage

labelMargin labelPos labelText labelVariable

state sticky

22See the "labeledwidget" widget manual entry for  details  on  the
23above inherited options.
24Name:           arrowOrient
25Class:          Orient
26Command‐Line Switch:           ‐arroworient
27Specifies  placement  of  arrow  buttons: horizontal or vertical.
28The default is vertical.
29Name:           decrement
30Class:          Command
31Command‐Line Switch:           ‐decrement
32Tcl command to be executed when down arrow is pressed.
33Name:           increment
34Class:          Command
35Command‐Line Switch:           ‐increment
36Tcl command to be executed when up arrow is pressed.
37Name:           repeatDelay
38Class:          RepeatDelay
39Command‐Line Switch:           ‐repeatdelay
40Specifies the initial delay in milliseconds  before  the  spinner
41repeat  action  on the arrow buttons engages.  The default is 300
42milliseconds.
43Name:           repeatInterval
44Class:          RepeatInterval
45Command‐Line Switch:           ‐repeatinterval
46Specifies the repeat delay in milliseconds between selections  of
47the arrow buttons.  A repeatinterval of 0 disables button repeat.
48The default is 100 milliseconds.
49
50The iwidgets::spinner command  creates  a  spinner  widget.   The
51spinner is comprised of an entryfield plus up and down arrow but‐
52tons.  Arrows may be drawn horizontally or vertically.
53
54The iwidgets::spinner command creates a  new  Tcl  command  whose
55name is pathName.  This command may be used to invoke various op‐
56erations on the widget.  It has the following general form: path‐

Name option ?arg arg ...? Option and the args determine the ex‐

58act behavior of the command.  The following commands are possible
59for spinner widgets:

delete get icursor index

insert scan selection xview

62See  the "entry" manual entry for details on the associated meth‐
63ods.

childsite clear peek

65See the "entryfield" manual entry for details on  the  associated
66methods.   pathName  cget option Returns the current value of the
67configuration option given by option.  Option may have any of the
68values  accepted by the iwidgets::spinner command.  pathName con‐

figure ?option? ?value option value ...? Query or modify the

70configuration  options of the widget.  If no option is specified,
71returns a list describing all of the available options for  path‐

Name (see Tk_ConfigureInfo for information on the format of this

73list).  If option is specified with no value,  then  the  command
74returns a list describing the one named option (this list will be
75identical to the corresponding sublist of the value  returned  if
76no  option  is specified).  If one or more option−value pairs are
77specified, then the command modifies the given  widget  option(s)
78to  have the given value(s);  in this case the command returns an
79empty string.  Option may have any of the values accepted by  the

iwidgets::spinner command. pathName down Derived classes may

81overload this method to specialize  functionality.   pathName  up
82Derived  classes may overload this method to specialize function‐
83ality.
84
85Name:           downarrow
86Class:          Canvas
87The downarrow component is the downward pointing  button  of  the
88spinner.  See the "canvas" widget manual entry for details on the
89downarrow component item.
90Name:           uparrow
91Class:          Canvas
92The uparrow component is the upward pointing button of the  spin‐
93ner.  See the "canvas" widget manual entry for details on the up‐
94arrow component item.
95
96 package require Iwidgets 4.0
97 set months {January February March April May June July \
98                 August September October November December}
99
100 proc blockInput {char} {
101     return 0
102 }
103
104 proc spinMonth {step} {
105     global months
106
107     set index [expr [lsearch $months [.sm get]] + $step]
108
109     if {$index < 0} {set index 11}
110     if {$index > 11} {set index 0}
111
112     .sm delete 0 end
113     .sm insert 0 [lindex $months $index]
114 }
115
116 iwidgets::spinner .sm ‐labeltext "Month : " ‐width 10 ‐fixed  10
117\
118   ‐validate  blockInput  ‐decrement  {spinMonth  ‐1}  ‐increment
119{spinMonth 1}
120 .sm insert 0 January
121
122 pack .sm ‐padx 10 ‐pady 10 Ken Copeland <ken@hilco.com> 10/18/95
123‐  Added auto‐repeat action to spinner arrow buttons.  Sue Yockey
124spinner, widget
125
126
127
128
129
130
131
132
Impressum