OSDN Git Service

*** empty log message ***
[pf3gnuchains/sourceware.git] / tk / doc / spinbox.n
1 '\"
2 '\" Copyright (c) 2000 Jeffrey Hobbs.
3 '\" Copyright (c) 2000 Ajuba Solutions.
4 '\"
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 '\" 
8 '\" RCS: @(#) $Id$
9 '\" 
10 .so man.macros
11 .TH spinbox n 8.4 Tk "Tk Built-In Commands"
12 .BS
13 '\" Note:  do not modify the .SH NAME line immediately below!
14 .SH NAME
15 spinbox \- Create and manipulate spinbox widgets
16 .SH SYNOPSIS
17 \fBspinbox\fR \fIpathName \fR?\fIoptions\fR?
18 .SO
19 \-activebackground      \-highlightthickness    \-repeatinterval
20 \-background    \-insertbackground      \-selectbackground
21 \-borderwidth   \-insertborderwidth     \-selectborderwidth
22 \-cursor        \-insertontime  \-selectforeground
23 \-exportselection       \-insertwidth   \-takefocus
24 \-font  \-insertofftime \-textvariable
25 \-foreground    \-justify       \-xscrollcommand
26 \-highlightbackground   \-relief
27 \-highlightcolor        \-repeatdelay
28 .SE
29 .SH "WIDGET-SPECIFIC OPTIONS"
30 .OP \-buttonbackground buttonBackground Background
31 The background color to be used for the spin buttons.
32 .OP \-buttoncursor buttonCursor Cursor
33 The cursor to be used when over the spin buttons.  If this is empty
34 (the default), a default cursor will be used.
35 .OP \-buttondownrelief buttonDownRelief Relief
36 The relief to be used for the upper spin button.
37 .OP \-buttonuprelief buttonUpRelief Relief
38 The relief to be used for the lower spin button.
39 .OP \-command command Command
40 Specifies a Tcl command to invoke whenever a spinbutton is invoked.
41 The command recognizes several percent substitutions: \fB%W\fR for
42 the widget path, \fB%s\fR for the current value of the widget, and
43 \fB%d\fR for the direction of the button pressed (\fBup\fR or \fBdown\fR).
44 .OP \-disabledbackground disabledBackground DisabledBackground
45 Specifies the background color to use when the spinbox is disabled.  If
46 this option is the empty string, the normal background color is used.
47 .OP \-disabledforeground disabledForeground DisabledForeground
48 Specifies the foreground color to use when the spinbox is disabled.  If
49 this option is the empty string, the normal foreground color is used.
50 .OP \-format format Format
51 Specifies an alternate format to use when setting the string value
52 when using the \fB\-from\fR and \fB\-to\fR range.
53 This must be a format specifier of the form \fB%<pad>.<pad>f\fR,
54 as it will format a floating-point number.
55 .OP \-from from From
56 A floating-point value corresponding to the lowest value for a spinbox, to
57 be used in conjunction with \fB\-to\fR and \fB\-increment\fR.  When all
58 are specified correctly, the spinbox will use these values to control its
59 contents.  This value must be less than the \fB\-to\fR option.
60 If \fB\-values\fR is specified, it supercedes this option.
61 .OP "\-invalidcommand or \-invcmd" invalidCommand InvalidCommand
62 Specifies a script to eval when \fBvalidateCommand\fR returns 0.  Setting
63 it to an empty string disables this feature (the default).  The best use of
64 this option is to set it to \fIbell\fR.  See \fBValidation\fR below for
65 more information.
66 .OP \-increment increment Increment
67 A floating-point value specifying the increment.  When used with
68 \fB\-from\fR and \fB\-to\fR, the value in the widget will be adjusted by
69 \fB\-increment\fR when a spin button is pressed (up adds the value,
70 down subtracts the value).
71 .OP \-readonlybackground readonlyBackground ReadonlyBackground
72 Specifies the background color to use when the spinbox is readonly.  If
73 this option is the empty string, the normal background color is used.
74 .OP \-state state State
75 Specifies one of three states for the spinbox:  \fBnormal\fR,
76 \fBdisabled\fR, or \fBreadonly\fR.  If the spinbox is readonly, then the
77 value may not be changed using widget commands and no insertion cursor
78 will be displayed, even if the input focus is in the widget; the
79 contents of the widget may still be selected.  If the spinbox is
80 disabled, the value may not be changed, no insertion cursor will be
81 displayed, the contents will not be selectable, and the spinbox may
82 be displayed in a different color, depending on the values of the
83 \fB-disabledforeground\fR and \fB-disabledbackground\fR options.
84 .OP \-to to To
85 A floating-point value corresponding to the highest value for the spinbox,
86 to be used in conjunction with \fB\-from\fR and \fB\-increment\fR.  When
87 all are specified correctly, the spinbox will use these values to control
88 its contents.  This value must be greater than the \fB\-from\fR option.
89 If \fB\-values\fR is specified, it supercedes this option.
90 .OP \-validate validate Validate
91 Specifies the mode in which validation should operate: \fBnone\fR,
92 \fBfocus\fR, \fBfocusin\fR, \fBfocusout\fR, \fBkey\fR, or \fBall\fR.
93 It defaults to \fBnone\fR.  When you want validation, you must explicitly
94 state which mode you wish to use.  See \fBValidation\fR below for more.
95 .OP "\-validatecommand or \-vcmd" validateCommand ValidateCommand
96 Specifies a script to evaluate when you want to validate the input in the
97 widget.  Setting it to an empty string disables this feature (the default).
98 Validation occurs according to the value of \fB\-validate\fR.
99 This command must return a valid Tcl boolean value.  If it returns 0 (or
100 the valid Tcl boolean equivalent) then the value of the widget will not
101 change and the \fBinvalidCommand\fR will be evaluated if it is set.  If it
102 returns 1, then value will be changed.
103 See \fBValidation\fR below for more information.
104 .OP \-values values Values
105 Must be a proper list value.  If specified, the spinbox will use these
106 values as to control its contents, starting with the first value.  This
107 option has precedence over the \fB\-from\fR and \fB\-to\fR range.
108 .OP \-width width Width
109 Specifies an integer value indicating the desired width of the spinbox window,
110 in average-size characters of the widget's font.
111 If the value is less than or equal to zero, the widget picks a
112 size just large enough to hold its current text.
113 .OP \-wrap wrap wrap
114 Must be a proper boolean value.  If on, the spinbox will wrap around the
115 values of data in the widget.
116 .BE
117
118 .SH DESCRIPTION
119 .PP
120 The \fBspinbox\fR command creates a new window (given by the
121 \fIpathName\fR argument) and makes it into a spinbox widget.
122 Additional options, described above, may be specified on the
123 command line or in the option database
124 to configure aspects of the spinbox such as its colors, font,
125 and relief.  The \fBspinbox\fR command returns its
126 \fIpathName\fR argument.  At the time this command is invoked,
127 there must not exist a window named \fIpathName\fR, but
128 \fIpathName\fR's parent must exist.
129 .PP
130 A \fBspinbox\fR is an extended \fBentry\fR widget that allows he user
131 to move, or spin, through a fixed set of ascending or descending values
132 such as times or dates in addition to editing the value as in an
133 \fBentry\fR.  When first created, a spinbox's string is empty.
134 A portion of the spinbox may be selected as described below.
135 If a spinbox is exporting its selection (see the \fBexportSelection\fR
136 option), then it will observe the standard protocols for handling the
137 selection;  spinbox selections are available as type \fBSTRING\fR.
138 Spinboxes also observe the standard Tk rules for dealing with the
139 input focus.  When a spinbox has the input focus it displays an
140 \fIinsertion cursor\fR to indicate where new characters will be
141 inserted.
142 .PP
143 Spinboxes are capable of displaying strings that are too long to
144 fit entirely within the widget's window.  In this case, only a
145 portion of the string will be displayed; commands described below
146 may be used to change the view in the window.  Spinboxes use
147 the standard \fBxScrollCommand\fR mechanism for interacting with
148 scrollbars (see the description of the \fBxScrollCommand\fR option
149 for details).  They also support scanning, as described below.
150
151 .SH VALIDATION
152 .PP
153 Validation works by setting the \fBvalidateCommand\fR
154 option to a script which will be evaluated according to the \fBvalidate\fR
155 option as follows:
156 .PP
157 .IP \fBnone\fR 10
158 Default.  This means no validation will occur.
159 .IP \fBfocus\fR 10
160 \fBvalidateCommand\fR will be called when the spinbox receives or
161 loses focus.
162 .IP \fBfocusin\fR 10
163 \fBvalidateCommand\fR will be called when the spinbox receives focus.
164 .IP \fBfocusout\fR 10
165 \fBvalidateCommand\fR will be called when the spinbox loses focus.
166 .IP \fBkey\fR 10
167 \fBvalidateCommand\fR will be called when the spinbox is edited.
168 .IP \fBall\fR 10
169 \fBvalidateCommand\fR will be called for all above conditions.
170 .PP
171 It is posible to perform percent substitutions on the \fBvalidateCommand\fR
172 and \fBinvalidCommand\fR, just as you would in a \fBbind\fR script.  The
173 following substitutions are recognized:
174 .PP
175 .IP \fB%d\fR 5
176 Type of action: 1 for \fBinsert\fR, 0 for \fBdelete\fR,
177 or -1 for focus, forced or textvariable validation.
178 .IP \fB%i\fR 5
179 Index of char string to be inserted/deleted, if any, otherwise -1.
180 .IP \fB%P\fR 5
181 The value of the spinbox should edition occur.  If you are configuring the
182 spinbox widget to have a new textvariable, this will be the value of that
183 textvariable.
184 .IP \fB%s\fR 5
185 The current value of spinbox before edition.
186 .IP \fB%S\fR 5
187 The text string being inserted/deleted, if any.
188 Otherwise it is an empty string.
189 .IP \fB%v\fR 5
190 The type of validation currently set.
191 .IP \fB%V\fR 5
192 The type of validation that triggered the callback
193 (key, focusin, focusout, forced).
194 .IP \fB%W\fR 5
195 The name of the spinbox widget.
196 .PP
197 In general, the \fBtextVariable\fR and \fBvalidateCommand\fR can be
198 dangerous to mix.  Any problems have been overcome so that using the
199 \fBvalidateCommand\fR will not interfere with the traditional behavior of
200 the spinbox widget.  Using the \fBtextVariable\fR for read-only purposes will
201 never cause problems.  The danger comes when you try set the
202 \fBtextVariable\fR to something that the \fBvalidateCommand\fR would not
203 accept, which causes \fBvalidate\fR to become \fInone\fR (the
204 \fBinvalidCommand\fR will not be triggered).  The same happens
205 when an error occurs evaluating the \fBvalidateCommand\fR.
206 .PP
207 Primarily, an error will occur when the \fBvalidateCommand\fR or
208 \fBinvalidCommand\fR encounters an error in its script while evaluating or
209 \fBvalidateCommand\fR does not return a valid Tcl boolean value.  The
210 \fBvalidate\fR option will also set itself to \fBnone\fR when you edit the
211 spinbox widget from within either the \fBvalidateCommand\fR or the
212 \fBinvalidCommand\fR.  Such editions will override the one that was being
213 validated.  If you wish to edit the value of the widget
214 during validation and still have the \fBvalidate\fR option set, you should
215 include the command
216 .CS
217      \fI%W config -validate %v\fR
218 .CE
219 in the \fBvalidateCommand\fR or \fBinvalidCommand\fR (whichever one you
220 were editing the spinbox widget from).  It is also recommended to not set an
221 associated \fBtextVariable\fR during validation, as that can cause the
222 spinbox widget to become out of sync with the \fBtextVariable\fR.
223
224 .SH "WIDGET COMMAND"
225 .PP
226 The \fBspinbox\fR command creates a new Tcl command whose
227 name is \fIpathName\fR.  This command may be used to invoke various
228 operations on the widget.  It has the following general form:
229 .CS
230 \fIpathName option \fR?\fIarg arg ...\fR?
231 .CE
232 \fIOption\fR and the \fIarg\fRs
233 determine the exact behavior of the command.
234 .PP
235 Many of the widget commands for spinboxes take one or more indices as
236 arguments.  An index specifies a particular character in the spinbox's
237 string, in any of the following ways:
238 .TP 12
239 \fInumber\fR
240 Specifies the character as a numerical index, where 0 corresponds
241 to the first character in the string.
242 .TP 12
243 \fBanchor\fR
244 Indicates the anchor point for the selection, which is set with the
245 \fBselect from\fR and \fBselect adjust\fR widget commands.
246 .TP 12
247 \fBend\fR
248 Indicates the character just after the last one in the spinbox's string.
249 This is equivalent to specifying a numerical index equal to the length
250 of the spinbox's string.
251 .TP 12
252 \fBinsert\fR
253 Indicates the character adjacent to and immediately following the
254 insertion cursor.
255 .TP 12
256 \fBsel.first\fR
257 Indicates the first character in the selection.  It is an error to
258 use this form if the selection isn't in the spinbox window.
259 .TP 12
260 \fBsel.last\fR
261 Indicates the character just after the last one in the selection.
262 It is an error to use this form if the selection isn't in the
263 spinbox window.
264 .TP 12
265 \fB@\fInumber\fR
266 In this form, \fInumber\fR is treated as an x-coordinate in the
267 spinbox's window;  the character spanning that x-coordinate is used.
268 For example, ``\fB@0\fR'' indicates the left-most character in the
269 window.
270 .LP
271 Abbreviations may be used for any of the forms above, e.g. ``\fBe\fR''
272 or ``\fBsel.f\fR''.  In general, out-of-range indices are automatically
273 rounded to the nearest legal value.
274 .PP
275 The following commands are possible for spinbox widgets:
276 .TP
277 \fIpathName \fBbbox \fIindex\fR
278 Returns a list of four numbers describing the bounding box of the
279 character given by \fIindex\fR.
280 The first two elements of the list give the x and y coordinates of
281 the upper-left corner of the screen area covered by the character
282 (in pixels relative to the widget) and the last two elements give
283 the width and height of the character, in pixels.
284 The bounding box may refer to a region outside the visible area
285 of the window.
286 .TP
287 \fIpathName \fBcget\fR \fIoption\fR
288 Returns the current value of the configuration option given
289 by \fIoption\fR.
290 \fIOption\fR may have any of the values accepted by the \fBspinbox\fR
291 command.
292 .TP
293 \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
294 Query or modify the configuration options of the widget.
295 If no \fIoption\fR is specified, returns a list describing all of
296 the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
297 information on the format of this list).  If \fIoption\fR is specified
298 with no \fIvalue\fR, then the command returns a list describing the
299 one named option (this list will be identical to the corresponding
300 sublist of the value returned if no \fIoption\fR is specified).  If
301 one or more \fIoption\-value\fR pairs are specified, then the command
302 modifies the given widget option(s) to have the given value(s);  in
303 this case the command returns an empty string.
304 \fIOption\fR may have any of the values accepted by the \fBspinbox\fR
305 command.
306 .TP
307 \fIpathName \fBdelete \fIfirst \fR?\fIlast\fR?
308 Delete one or more elements of the spinbox.
309 \fIFirst\fR is the index of the first character to delete, and
310 \fIlast\fR is the index of the character just after the last
311 one to delete.
312 If \fIlast\fR isn't specified it defaults to \fIfirst\fR+1,
313 i.e. a single character is deleted.
314 This command returns an empty string.
315 .TP
316 \fIpathName \fBget\fR
317 Returns the spinbox's string.
318 .TP
319 \fIpathName \fBicursor \fIindex\fR
320 Arrange for the insertion cursor to be displayed just before the character
321 given by \fIindex\fR.  Returns an empty string.
322 .TP
323 \fIpathName \fBidentify\fI x y\fR
324 Returns the name of the window element corresponding to coordinates
325 \fIx\fR and \fIy\fR in the spinbox.  Return value is one of:
326 \fBnone\fR, \fBbuttondown\fR, \fBbuttonup\fR, \fBentry\fR.
327 .TP
328 \fIpathName \fBindex\fI index\fR
329 Returns the numerical index corresponding to \fIindex\fR.
330 .TP
331 \fIpathName \fBinsert \fIindex string\fR
332 Insert the characters of \fIstring\fR just before the character
333 indicated by \fIindex\fR.  Returns an empty string.
334 .TP
335 \fIpathName \fBinvoke\fI element\fR
336 Causes the specified element, either \fBbuttondown\fR or \fBbuttonup\fR,
337 to be invoked, triggering the action associated with it.
338 .TP
339 \fIpathName \fBscan\fR \fIoption args\fR
340 This command is used to implement scanning on spinboxes.  It has
341 two forms, depending on \fIoption\fR:
342 .RS
343 .TP
344 \fIpathName \fBscan mark \fIx\fR
345 Records \fIx\fR and the current view in the spinbox window;  used in
346 conjunction with later \fBscan dragto\fR commands.  Typically this
347 command is associated with a mouse button press in the widget.  It
348 returns an empty string.
349 .TP
350 \fIpathName \fBscan dragto \fIx\fR
351 This command computes the difference between its \fIx\fR argument
352 and the \fIx\fR argument to the last \fBscan mark\fR command for
353 the widget.  It then adjusts the view left or right by 10 times the
354 difference in x-coordinates.  This command is typically associated
355 with mouse motion events in the widget, to produce the effect of
356 dragging the spinbox at high speed through the window.  The return
357 value is an empty string.
358 .RE
359 .TP
360 \fIpathName \fBselection \fIoption arg\fR
361 This command is used to adjust the selection within a spinbox.  It
362 has several forms, depending on \fIoption\fR:
363 .RS
364 .TP
365 \fIpathName \fBselection adjust \fIindex\fR
366 Locate the end of the selection nearest to the character given by
367 \fIindex\fR, and adjust that end of the selection to be at \fIindex\fR
368 (i.e including but not going beyond \fIindex\fR).  The other
369 end of the selection is made the anchor point for future
370 \fBselect to\fR commands.  If the selection
371 isn't currently in the spinbox, then a new selection is created to
372 include the characters between \fIindex\fR and the most recent
373 selection anchor point, inclusive.
374 Returns an empty string.
375 .TP
376 \fIpathName \fBselection clear\fR
377 Clear the selection if it is currently in this widget.  If the
378 selection isn't in this widget then the command has no effect.
379 Returns an empty string.
380 .TP
381 \fIpathName \fBselection element\fR ?\fIelement\fR?
382 Sets or gets the currently selected element.  If a spinbutton element
383 is specified, it will be displayed depressed.
384 .TP
385 \fIpathName \fBselection from \fIindex\fR
386 Set the selection anchor point to just before the character
387 given by \fIindex\fR.  Doesn't change the selection.
388 Returns an empty string.
389 .TP
390 \fIpathName \fBselection present\fR
391 Returns 1 if there is are characters selected in the spinbox,
392 0 if nothing is selected.
393 .TP
394 \fIpathName \fBselection range \fIstart\fR \fIend\fR
395 Sets the selection to include the characters starting with
396 the one indexed by \fIstart\fR and ending with the one just
397 before \fIend\fR.
398 If \fIend\fR refers to the same character as \fIstart\fR or an
399 earlier one, then the spinbox's selection is cleared.
400 .TP
401 \fIpathName \fBselection to \fIindex\fR
402 If \fIindex\fR is before the anchor point, set the selection
403 to the characters from \fIindex\fR up to but not including
404 the anchor point.
405 If \fIindex\fR is the same as the anchor point, do nothing.
406 If \fIindex\fR is after the anchor point, set the selection
407 to the characters from the anchor point up to but not including
408 \fIindex\fR.
409 The anchor point is determined by the most recent \fBselect from\fR
410 or \fBselect adjust\fR command in this widget.
411 If the selection isn't in this widget then a new selection is
412 created using the most recent anchor point specified for the widget.
413 Returns an empty string.
414 .RE
415 .TP
416 \fIpathName \fBset\fR ?\fIstring\fR?
417 If \fIstring\fR is specified, the spinbox will try and set it to this
418 value, otherwise it just returns the spinbox's string.
419 If validation is on, it will occur when setting the string.
420 .TP
421 \fIpathName \fBvalidate\fR
422 This command is used to force an evaluation of the \fBvalidateCommand\fR
423 independent of the conditions specified by the \fBvalidate\fR option.
424 This is done by temporarily setting the \fBvalidate\fR option to \fBall\fR.
425 It returns 0 or 1.
426 .TP
427 \fIpathName \fBxview \fIargs\fR
428 This command is used to query and change the horizontal position of the
429 text in the widget's window.  It can take any of the following
430 forms:
431 .RS
432 .TP
433 \fIpathName \fBxview\fR
434 Returns a list containing two elements.
435 Each element is a real fraction between 0 and 1;  together they describe
436 the horizontal span that is visible in the window.
437 For example, if the first element is .2 and the second element is .6,
438 20% of the spinbox's text is off-screen to the left, the middle 40% is visible
439 in the window, and 40% of the text is off-screen to the right.
440 These are the same values passed to scrollbars via the \fB\-xscrollcommand\fR
441 option.
442 .TP
443 \fIpathName \fBxview\fR \fIindex\fR
444 Adjusts the view in the window so that the character given by \fIindex\fR
445 is displayed at the left edge of the window.
446 .TP
447 \fIpathName \fBxview moveto\fI fraction\fR
448 Adjusts the view in the window so that the character \fIfraction\fR of the
449 way through the text appears at the left edge of the window.
450 \fIFraction\fR must be a fraction between 0 and 1.
451 .TP
452 \fIpathName \fBxview scroll \fInumber what\fR
453 This command shifts the view in the window left or right according to
454 \fInumber\fR and \fIwhat\fR.
455 \fINumber\fR must be an integer.
456 \fIWhat\fR must be either \fBunits\fR or \fBpages\fR or an abbreviation
457 of one of these.
458 If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by
459 \fInumber\fR average-width characters on the display;  if it is
460 \fBpages\fR then the view adjusts by \fInumber\fR screenfuls.
461 If \fInumber\fR is negative then characters farther to the left
462 become visible;  if it is positive then characters farther to the right
463 become visible.
464 .RE
465
466 .SH "DEFAULT BINDINGS"
467 .PP
468 Tk automatically creates class bindings for spinboxes that give them
469 the following default behavior.
470 In the descriptions below, ``word'' refers to a contiguous group
471 of letters, digits, or ``_'' characters, or any single character
472 other than these.
473 .IP [1]
474 Clicking mouse button 1 positions the insertion cursor
475 just before the character underneath the mouse cursor, sets the
476 input focus to this widget, and clears any selection in the widget.
477 Dragging with mouse button 1 strokes out a selection between
478 the insertion cursor and the character under the mouse.
479 .IP [2]
480 Double-clicking with mouse button 1 selects the word under the mouse
481 and positions the insertion cursor at the beginning of the word.
482 Dragging after a double click will stroke out a selection consisting
483 of whole words.
484 .IP [3]
485 Triple-clicking with mouse button 1 selects all of the text in the
486 spinbox and positions the insertion cursor before the first character.
487 .IP [4]
488 The ends of the selection can be adjusted by dragging with mouse
489 button 1 while the Shift key is down;  this will adjust the end
490 of the selection that was nearest to the mouse cursor when button
491 1 was pressed.
492 If the button is double-clicked before dragging then the selection
493 will be adjusted in units of whole words.
494 .IP [5]
495 Clicking mouse button 1 with the Control key down will position the
496 insertion cursor in the spinbox without affecting the selection.
497 .IP [6]
498 If any normal printing characters are typed in a spinbox, they are
499 inserted at the point of the insertion cursor.
500 .IP [7]
501 The view in the spinbox can be adjusted by dragging with mouse button 2.
502 If mouse button 2 is clicked without moving the mouse, the selection
503 is copied into the spinbox at the position of the mouse cursor.
504 .IP [8]
505 If the mouse is dragged out of the spinbox on the left or right sides
506 while button 1 is pressed, the spinbox will automatically scroll to
507 make more text visible (if there is more text off-screen on the side
508 where the mouse left the window).
509 .IP [9]
510 The Left and Right keys move the insertion cursor one character to the
511 left or right;  they also clear any selection in the spinbox and set
512 the selection anchor.
513 If Left or Right is typed with the Shift key down, then the insertion
514 cursor moves and the selection is extended to include the new character.
515 Control-Left and Control-Right move the insertion cursor by words, and
516 Control-Shift-Left and Control-Shift-Right move the insertion cursor
517 by words and also extend the selection.
518 Control-b and Control-f behave the same as Left and Right, respectively.
519 Meta-b and Meta-f behave the same as Control-Left and Control-Right,
520 respectively.
521 .IP [10]
522 The Home key, or Control-a, will move the insertion cursor to the
523 beginning of the spinbox and clear any selection in the spinbox.
524 Shift-Home moves the insertion cursor to the beginning of the spinbox
525 and also extends the selection to that point.
526 .IP [11]
527 The End key, or Control-e, will move the insertion cursor to the
528 end of the spinbox and clear any selection in the spinbox.
529 Shift-End moves the cursor to the end and extends the selection
530 to that point.
531 .IP [12]
532 The Select key and Control-Space set the selection anchor to the position
533 of the insertion cursor.  They don't affect the current selection.
534 Shift-Select and Control-Shift-Space adjust the selection to the
535 current position of the insertion cursor, selecting from the anchor
536 to the insertion cursor if there was not any selection previously.
537 .IP [13]
538 Control-/ selects all the text in the spinbox.
539 .IP [14]
540 Control-\e clears any selection in the spinbox.
541 .IP [15]
542 The F16 key (labelled Copy on many Sun workstations) or Meta-w
543 copies the selection in the widget to the clipboard, if there is a selection.
544 .IP [16]
545 The F20 key (labelled Cut on many Sun workstations) or Control-w
546 copies the selection in the widget to the clipboard and deletes
547 the selection.
548 If there is no selection in the widget then these keys have no effect.
549 .IP [17]
550 The F18 key (labelled Paste on many Sun workstations) or Control-y
551 inserts the contents of the clipboard at the position of the
552 insertion cursor.
553 .IP [18]
554 The Delete key deletes the selection, if there is one in the spinbox.
555 If there is no selection, it deletes the character to the right of
556 the insertion cursor.
557 .IP [19]
558 The BackSpace key and Control-h delete the selection, if there is one
559 in the spinbox.
560 If there is no selection, it deletes the character to the left of
561 the insertion cursor.
562 .IP [20]
563 Control-d deletes the character to the right of the insertion cursor.
564 .IP [21]
565 Meta-d deletes the word to the right of the insertion cursor.
566 .IP [22]
567 Control-k deletes all the characters to the right of the insertion
568 cursor.
569 .IP [23]
570 Control-t reverses the order of the two characters to the right of
571 the insertion cursor.
572 .PP
573 If the spinbox is disabled using the \fB\-state\fR option, then the spinbox's
574 view can still be adjusted and text in the spinbox can still be selected,
575 but no insertion cursor will be displayed and no text modifications will
576 take place.
577 .PP
578 The behavior of spinboxes can be changed by defining new bindings for
579 individual widgets or by redefining the class bindings.
580
581 .SH KEYWORDS
582 spinbox, entry, widget