Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # Copyright (c) 1990-1994 The Regents of the University of California. |
2 | # Copyright (c) 1994-1996 Sun Microsystems, Inc. | |
3 | # See the file "license.terms" for information on usage and redistribution | |
4 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. | |
5 | # | |
6 | # | |
7 | ||
8 | =head1 NAME | |
9 | ||
10 | Tk::options - Standard options supported by widgets and their manipulation | |
11 | ||
12 | =for category Creating and Configuring Widgets | |
13 | ||
14 | =head1 SYNOPSIS | |
15 | ||
16 | S< >I<$value> = I<$widget>-E<gt>B<cget>('I<-option>'); | |
17 | ||
18 | S< >I<$widget>-E<gt>B<configure>(I<-option>=E<gt>I<value> ?,I<-option>=E<gt>I<value> ...?); | |
19 | ||
20 | S< >I<@list> = I<$widget>-E<gt>B<configure>('I<-option>'); | |
21 | ||
22 | S< >I<@lol> = I<$widget>-E<gt>B<configure>; | |
23 | ||
24 | =head1 DESCRIPTION | |
25 | ||
26 | All widgets, and images have a standard mechanism for setting and querying | |
27 | attibutes or options. The mechanism is based on two methods B<configure> | |
28 | and B<cget>. The behaviour of these methods is as follows: | |
29 | ||
30 | =over 4 | |
31 | ||
32 | =item I<$widget>-E<gt>B<configure>(I<-option>=E<gt>I<value> ?,I<-option>=E<gt>I<value> ...?); | |
33 | ||
34 | Sets the values of I<-option> to I<value> for each I<-option>=E<gt>I<value> | |
35 | pair. The internal B<new> method does an implicit B<configure> in this | |
36 | form with options passed in at widget create time. | |
37 | ||
38 | =item I<$widget>-E<gt>B<configure>('I<-option>') | |
39 | ||
40 | In array context returns a list of five or two elements. If I<-option> | |
41 | is an alias for another options it return a list consisting of the | |
42 | alias option and the name for the option is is an alias for, e.g., | |
43 | C<('-bg', 'background')>. If I<-option> is not an alias the returned | |
44 | list has the following five elements: | |
45 | ||
46 | =over 8 | |
47 | ||
48 | =item I<Option Name> | |
49 | ||
50 | The value of I<-option>, e.g., B<-background>. | |
51 | ||
52 | =item I<Name> | |
53 | ||
54 | The option's name in the option database, e.g., C<background>. | |
55 | ||
56 | =item I<Class> | |
57 | ||
58 | The option's class value in the option database, e.g., C<Background>. | |
59 | ||
60 | =item I<Default> | |
61 | ||
62 | The default value for the option if not specified or in the option database, | |
63 | e.g., C<grey>. | |
64 | ||
65 | =item I<Value> | |
66 | ||
67 | The current value (as returned by B<cget>), e.g., C<white>. | |
68 | ||
69 | =back | |
70 | ||
71 | =item I<$widget>-E<gt>B<configure> | |
72 | ||
73 | Returns a list of lists for all the options supported by I<$widget>. | |
74 | Each sub-list is in the form returned by B<configure>('I<-option>'). | |
75 | (This mechanism is used by the B<Tk::Derived> class to determine | |
76 | the options available from base class.) | |
77 | ||
78 | =item I<$widget>-E<gt>B<cget>('I<-option>') | |
79 | ||
80 | Returns the current value of I<-option> for I<$widget>. | |
81 | ||
82 | B<cget>('I<-option>') is clumsy with the need for B<''> due to perl's | |
83 | parsing rules. Something more subtle using L<tie|perlfunc/tie> might look better. | |
84 | ||
85 | =back | |
86 | ||
87 | The following paragraphs describe the common configuration options supported by | |
88 | widgets in the Tk toolkit. Every widget does not necessarily support every option | |
89 | (see the the documentation entries for individual widgets for a list of the | |
90 | standard options supported by that widget), but if a widget does support an option | |
91 | with one of the names listed below, then the option has exactly the effect | |
92 | described below. | |
93 | ||
94 | In the descriptions below, ``Name'' refers to the option's name in the option | |
95 | database. ``Class'' refers to the option's class value | |
96 | in the option database. ``Switch'' refers to the switch used in widget-creation | |
97 | and B<configure> widget methods to set this value. For example, if an option's | |
98 | configure option is B<-foreground> and there exists a widget I<$widget>, then the | |
99 | call: | |
100 | ||
101 | S< >I<$widget>-E<gt>B<configure>(B<-foreground>=E<gt>B<'black'>) | |
102 | ||
103 | may be used to specify the value B<black> for the option in the widget I<$widget>. | |
104 | Configure options may be abbreviated, as long as the abbreviation is unambiguous | |
105 | (abbreviation is deprecated in perl/Tk). | |
106 | ||
107 | =head2 Creation options: Widget Name and Class | |
108 | ||
109 | The B<Name> and B<-class> options can only be specified when a widget is | |
110 | created, and cannot be changed with B<configure>. These options determine | |
111 | the widget's identity and how Tk applies resource values from the | |
112 | option database (see L<Tk::option>) and so they | |
113 | cannot be assigned by the options database. | |
114 | ||
115 | =over 4 | |
116 | ||
117 | =item Name: I<name> | |
118 | ||
119 | =item Switch: B<Name> | |
120 | ||
121 | Specifies the path element for the widget. Names generally begin with a | |
122 | lowercase letter. | |
123 | ||
124 | Each widget has a unique I<pathname> that follows the hierarchy from the | |
125 | B<MainWindow> to the widget itself. Since the widget's B<PathName> is | |
126 | used to assign options from the options database, it is important to | |
127 | specify a distinctive B<Name> for any widget that will have non-default | |
128 | options. See L<Tk::option> for details. | |
129 | ||
130 | =item Name: I<class> | |
131 | ||
132 | =item Switch: B<-class> | |
133 | ||
134 | Specifies a class for the window. Classes generally begin with an | |
135 | uppercase letter. | |
136 | ||
137 | This class will be used when querying the option database for | |
138 | the window's other options (see Tk::options), and it will also be used | |
139 | later for other purposes such as bindings. One typically assigns a class | |
140 | to a B<TopLevel> or B<Frame> so that the class will apply to all of | |
141 | that widget's children. | |
142 | ||
143 | =back | |
144 | ||
145 | =head2 Reconfigurable options | |
146 | ||
147 | These options can be set at widget creation or changed later via B<configure>. | |
148 | ||
149 | =over 4 | |
150 | ||
151 | =item Name: B<activeBackground> | |
152 | ||
153 | =item Class: B<Foreground> | |
154 | ||
155 | =item Switch: B<-activebackground> | |
156 | ||
157 | Specifies background color to use when drawing active elements. | |
158 | An element (a widget or portion of a widget) is active if the | |
159 | mouse cursor is positioned over the element and pressing a mouse button | |
160 | will cause some action to occur. | |
161 | If strict Motif compliance has been requested by setting the | |
162 | B<$Tk::strictMotif> variable, this option will normally be | |
163 | ignored; the normal background color will be used instead. | |
164 | For some elements on Windows and Macintosh systems, the active color | |
165 | will only be used while mouse button 1 is pressed over the element. | |
166 | ||
167 | =item Name: B<activeBorderWidth> | |
168 | ||
169 | =item Class: B<BorderWidth> | |
170 | ||
171 | =item Switch: B<-activeborderwidth> | |
172 | ||
173 | Specifies a non-negative value indicating | |
174 | the width of the 3-D border drawn around active elements. | |
175 | See above for definition of active elements. | |
176 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
177 | This option is typically only available in widgets displaying more | |
178 | than one element at a time (e.g. menus but not buttons). | |
179 | ||
180 | =item Name: B<activeForeground> | |
181 | ||
182 | =item Class: B<Background> | |
183 | ||
184 | =item Switch: B<-activeforeground> | |
185 | ||
186 | Specifies foreground color to use when drawing active elements. | |
187 | See above for definition of active elements. | |
188 | ||
189 | =item Name: B<activetile> | |
190 | ||
191 | =item Class: B<Tile> | |
192 | ||
193 | =item Switch: B<-activetile> | |
194 | ||
195 | Specifies image used to display inside active elements of the widget. | |
196 | See above for definition of active elements. | |
197 | ||
198 | =item Name: B<anchor> | |
199 | ||
200 | =item Class: B<Anchor> | |
201 | ||
202 | =item Switch: B<-anchor> | |
203 | ||
204 | Specifies how the information in a widget (e.g. text or a bitmap) | |
205 | is to be displayed in the widget. | |
206 | Must be one of the values B<n>, B<ne>, B<e>, B<se>, | |
207 | B<s>, B<sw>, B<w>, B<nw>, or B<center>. | |
208 | For example, B<nw> means display the information such that its | |
209 | top-left corner is at the top-left corner of the widget. | |
210 | ||
211 | =item Name: B<background> | |
212 | ||
213 | =item Class: B<Background> | |
214 | ||
215 | =item Switch: B<-background> | |
216 | ||
217 | =item Alias: B<-bg> | |
218 | ||
219 | Specifies the normal background color to use when displaying the | |
220 | widget. | |
221 | ||
222 | =item Name: B<bitmap> | |
223 | ||
224 | =item Class: B<Bitmap> | |
225 | ||
226 | =item Switch: B<-bitmap> | |
227 | ||
228 | Specifies a bitmap to display in the widget, in any of the forms | |
229 | acceptable to B<Tk_GetBitmap>. | |
230 | The exact way in which the bitmap is displayed may be affected by | |
231 | other options such as B<-anchor> or B<-justify>. | |
232 | Typically, if this option is specified then it overrides other | |
233 | options that specify a textual value to display in the widget; | |
234 | the B<-bitmap> option may be reset to an empty string to re-enable | |
235 | a text display. | |
236 | In widgets that support both B<-bitmap> and B<-image> options, | |
237 | B<-image> will usually override B<-bitmap>. | |
238 | ||
239 | =item Name: B<borderWidth> | |
240 | ||
241 | =item Class: B<BorderWidth> | |
242 | ||
243 | =item Switch: B<-borderwidth> | |
244 | ||
245 | =item Alias: B<-bd> | |
246 | ||
247 | Specifies a non-negative value indicating the width | |
248 | of the 3-D border to draw around the outside of the widget (if such a | |
249 | border is being drawn; the B<relief> option typically determines | |
250 | this). The value may also be used when drawing 3-D effects in the | |
251 | interior of the widget. | |
252 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
253 | ||
254 | =item Name: B<cursor> | |
255 | ||
256 | =item Class: B<Cursor> | |
257 | ||
258 | =item Switch: B<-cursor> | |
259 | ||
260 | Specifies the mouse cursor to be used for the widget. | |
261 | The value may have any of the forms acceptable to B<Tk_GetCursor>. | |
262 | ||
263 | =item Name: B<dash> | |
264 | ||
265 | =item Class: B<Dash> | |
266 | ||
267 | =item Switch: B<-dash> | |
268 | ||
269 | The value may have any of the forms accepted by B<Tk_GetDash>, | |
270 | such as B<4>, B<[6,4]>, B<.>, B<->, B<-.>, or B<-..>. | |
271 | ||
272 | =item Name: B<dashoffset> | |
273 | ||
274 | =item Class: B<Dashoffset> | |
275 | ||
276 | =item Switch: B<-dashoffset> | |
277 | ||
278 | Specifies the offset in the dash list where the drawing starts. | |
279 | ||
280 | =item Name: B<disabledForeground> | |
281 | ||
282 | =item Class: B<DisabledForeground> | |
283 | ||
284 | =item Switch: B<-disabledforeground> | |
285 | ||
286 | Specifies foreground color to use when drawing a disabled element. | |
287 | If the option is specified as an empty string (which is typically the | |
288 | case on monochrome displays), disabled elements are drawn with the | |
289 | normal foreground color but they are dimmed by drawing them | |
290 | with a stippled fill pattern. | |
291 | ||
292 | =item Name: B<disabledtile> | |
293 | ||
294 | =item Class: B<Tile> | |
295 | ||
296 | =item Switch: B<-disabledtile> | |
297 | ||
298 | Specifies image to use when drawing a disabled element. | |
299 | ||
300 | =item Name: B<exportSelection> | |
301 | ||
302 | =item Class: B<ExportSelection> | |
303 | ||
304 | =item Switch: B<-exportselection> | |
305 | ||
306 | Specifies whether or not a selection in the widget should also be | |
307 | the X selection. | |
308 | The value may have any of the forms accepted by B<Tcl_GetBoolean>, | |
309 | such as B<true>, B<false>, B<0>, B<1>, B<yes>, or B<no>. | |
310 | If the selection is exported, then selecting in the widget deselects | |
311 | the current X selection, selecting outside the widget deselects any | |
312 | widget selection, and the widget will respond to selection retrieval | |
313 | requests when it has a selection. The default is usually for widgets | |
314 | to export selections. | |
315 | ||
316 | =item Name: B<font> | |
317 | ||
318 | =item Class: B<Font> | |
319 | ||
320 | =item Switch: B<-font> | |
321 | ||
322 | Specifies the font to use when drawing text inside the widget. | |
323 | ||
324 | =item Name: B<foreground> | |
325 | ||
326 | =item Class: B<Foreground> | |
327 | ||
328 | =item Switch: B<-foreground> | |
329 | ||
330 | =item Alias: B<-fg> | |
331 | ||
332 | Specifies the normal foreground color to use when displaying the widget. | |
333 | ||
334 | =item Name: B<highlightBackground> | |
335 | ||
336 | =item Class: B<HighlightBackground> | |
337 | ||
338 | =item Switch: B<-highlightbackground> | |
339 | ||
340 | Specifies the color to display in the traversal highlight region when | |
341 | the widget does not have the input focus. | |
342 | ||
343 | =item Name: B<highlightColor> | |
344 | ||
345 | =item Class: B<HighlightColor> | |
346 | ||
347 | =item Switch: B<-highlightcolor> | |
348 | ||
349 | Specifies the color to use for the traversal highlight rectangle that is | |
350 | drawn around the widget when it has the input focus. | |
351 | ||
352 | =item Name: B<highlightThickness> | |
353 | ||
354 | =item Class: B<HighlightThickness> | |
355 | ||
356 | =item Switch: B<-highlightthickness> | |
357 | ||
358 | Specifies a non-negative value indicating the width of the highlight | |
359 | rectangle to draw around the outside of the widget when it has the | |
360 | input focus. | |
361 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
362 | If the value is zero, no focus highlight is drawn around the widget. | |
363 | ||
364 | =item Name: B<image> | |
365 | ||
366 | =item Class: B<Image> | |
367 | ||
368 | =item Switch: B<-image> | |
369 | ||
370 | Specifies an image to display in the widget, which must have been | |
371 | created with an image create. (See L<Tk::Image> for details of image creation.) | |
372 | Typically, if the B<-image> option is specified then it overrides other | |
373 | options that specify a bitmap or textual value to display in the widget; | |
374 | the B<-image> option may be reset to an empty string to re-enable | |
375 | a bitmap or text display. | |
376 | ||
377 | =item Name: B<insertBackground> | |
378 | ||
379 | =item Class: B<Foreground> | |
380 | ||
381 | =item Switch: B<-insertbackground> | |
382 | ||
383 | Specifies the color to use as background in the area covered by the | |
384 | insertion cursor. This color will normally override either the normal | |
385 | background for the widget (or the selection background if the insertion | |
386 | cursor happens to fall in the selection). | |
387 | ||
388 | =item Name: B<insertBorderWidth> | |
389 | ||
390 | =item Class: B<BorderWidth> | |
391 | ||
392 | =item Switch: B<-insertborderwidth> | |
393 | ||
394 | Specifies a non-negative value indicating the width | |
395 | of the 3-D border to draw around the insertion cursor. | |
396 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
397 | ||
398 | =item Name: B<insertOffTime> | |
399 | ||
400 | =item Class: B<OffTime> | |
401 | ||
402 | =item Switch: B<-insertofftime> | |
403 | ||
404 | Specifies a non-negative integer value indicating the number of | |
405 | milliseconds the insertion cursor should remain ``off'' in each blink cycle. | |
406 | If this option is zero then the cursor doesn't blink: it is on | |
407 | all the time. | |
408 | ||
409 | =item Name: B<insertOnTime> | |
410 | ||
411 | =item Class: B<OnTime> | |
412 | ||
413 | =item Switch: B<-insertontime> | |
414 | ||
415 | Specifies a non-negative integer value indicating the number of | |
416 | milliseconds the insertion cursor should remain ``on'' in each blink cycle. | |
417 | ||
418 | =item Name: B<insertWidth> | |
419 | ||
420 | =item Class: B<InsertWidth> | |
421 | ||
422 | =item Switch: B<-insertwidth> | |
423 | ||
424 | Specifies a value indicating the total width of the insertion cursor. | |
425 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
426 | If a border has been specified for the insertion | |
427 | cursor (using the B<insertBorderWidth> option), the border | |
428 | will be drawn inside the width specified by the B<insertWidth> | |
429 | option. | |
430 | ||
431 | =item Name: B<jump> | |
432 | ||
433 | =item Class: B<Jump> | |
434 | ||
435 | =item Switch: B<-jump> | |
436 | ||
437 | For widgets with a slider that can be dragged to adjust a value, | |
438 | such as scrollbars, this option determines when | |
439 | notifications are made about changes in the value. | |
440 | The option's value must be a boolean of the form accepted by | |
441 | B<Tcl_GetBoolean>. | |
442 | If the value is false, updates are made continuously as the | |
443 | slider is dragged. | |
444 | If the value is true, updates are delayed until the mouse button | |
445 | is released to end the drag; at that point a single notification | |
446 | is made (the value ``jumps'' rather than changing smoothly). | |
447 | ||
448 | =item Name: B<justify> | |
449 | ||
450 | =item Class: B<Justify> | |
451 | ||
452 | =item Switch: B<-justify> | |
453 | ||
454 | When there are multiple lines of text displayed in a widget, this | |
455 | option determines how the lines line up with each other. | |
456 | Must be one of B<left>, B<center>, or B<right>. | |
457 | B<Left> means that the lines' left edges all line up, B<center> | |
458 | means that the lines' centers are aligned, and B<right> means | |
459 | that the lines' right edges line up. | |
460 | ||
461 | =item Name: B<offset> | |
462 | ||
463 | =item Class: B<Offset> | |
464 | ||
465 | =item Switch: B<-offset> | |
466 | ||
467 | Specifies the offset of tiles (see also B<-tile> option). It can | |
468 | have two different formats B<-offset x,y> or B<-offset side>, | |
469 | where side can be B<n>, B<ne>, B<e>, B<se>, B<s>, | |
470 | B<sw>, B<w>, B<nw>, or B<center>. In the first case | |
471 | the origin is the origin of the toplevel of the current window. | |
472 | For the canvas itself and canvas objects the origin is the canvas | |
473 | origin, but putting B<#> in front of the coordinate pair | |
474 | indicates using the toplevel origin in stead. For canvas objects, | |
475 | the B<-offset> option is used for stippling as well. | |
476 | For the line and polygon canvas items you can also specify | |
477 | an index as argument, which connects the stipple or tile | |
478 | origin to one of the coordinate points of the line/polygon. | |
479 | ||
480 | =item Name: B<orient> | |
481 | ||
482 | =item Class: B<Orient> | |
483 | ||
484 | =item Switch: B<-orient> | |
485 | ||
486 | For widgets that can lay themselves out with either a horizontal | |
487 | or vertical orientation, such as scrollbars, this option specifies | |
488 | which orientation should be used. Must be either B<horizontal> | |
489 | or B<vertical> or an abbreviation of one of these. | |
490 | ||
491 | =item Name: B<padX> | |
492 | ||
493 | =item Class: B<Pad> | |
494 | ||
495 | =item Switch: B<-padx> | |
496 | ||
497 | Specifies a non-negative value indicating how much extra space | |
498 | to request for the widget in the X-direction. | |
499 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
500 | When computing how large a window it needs, the widget will | |
501 | add this amount to the width it would normally need (as determined | |
502 | by the width of the things displayed in the widget); if the geometry | |
503 | manager can satisfy this request, the widget will end up with extra | |
504 | internal space to the left and/or right of what it displays inside. | |
505 | Most widgets only use this option for padding text: if they are | |
506 | displaying a bitmap or image, then they usually ignore padding | |
507 | options. | |
508 | ||
509 | =item Name: B<padY> | |
510 | ||
511 | =item Class: B<Pad> | |
512 | ||
513 | =item Switch: B<-pady> | |
514 | ||
515 | Specifies a non-negative value indicating how much extra space | |
516 | to request for the widget in the Y-direction. | |
517 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
518 | When computing how large a window it needs, the widget will add | |
519 | this amount to the height it would normally need (as determined by | |
520 | the height of the things displayed in the widget); if the geometry | |
521 | manager can satisfy this request, the widget will end up with extra | |
522 | internal space above and/or below what it displays inside. | |
523 | Most widgets only use this option for padding text: if they are | |
524 | displaying a bitmap or image, then they usually ignore padding | |
525 | options. | |
526 | ||
527 | =item Name: B<relief> | |
528 | ||
529 | =item Class: B<Relief> | |
530 | ||
531 | =item Switch: B<-relief> | |
532 | ||
533 | Specifies the 3-D effect desired for the widget. Acceptable | |
534 | values are B<raised>, B<sunken>, B<flat>, B<ridge>, | |
535 | B<solid>, and B<groove>. | |
536 | The value | |
537 | indicates how the interior of the widget should appear relative | |
538 | to its exterior; for example, B<raised> means the interior of | |
539 | the widget should appear to protrude from the screen, relative to | |
540 | the exterior of the widget. | |
541 | ||
542 | =item Name: B<repeatDelay> | |
543 | ||
544 | =item Class: B<RepeatDelay> | |
545 | ||
546 | =item Switch: B<-repeatdelay> | |
547 | ||
548 | Specifies the number of milliseconds a button or key must be held | |
549 | down before it begins to auto-repeat. Used, for example, on the | |
550 | up- and down-arrows in scrollbars. | |
551 | ||
552 | =item Name: B<repeatInterval> | |
553 | ||
554 | =item Class: B<RepeatInterval> | |
555 | ||
556 | =item Switch: B<-repeatinterval> | |
557 | ||
558 | Used in conjunction with B<repeatDelay>: once auto-repeat | |
559 | begins, this option determines the number of milliseconds between | |
560 | auto-repeats. | |
561 | ||
562 | =item Name: B<selectBackground> | |
563 | ||
564 | =item Class: B<Foreground> | |
565 | ||
566 | =item Switch: B<-selectbackground> | |
567 | ||
568 | Specifies the background color to use when displaying selected | |
569 | items. | |
570 | ||
571 | =item Name: B<selectBorderWidth> | |
572 | ||
573 | =item Class: B<BorderWidth> | |
574 | ||
575 | =item Switch: B<-selectborderwidth> | |
576 | ||
577 | Specifies a non-negative value indicating the width | |
578 | of the 3-D border to draw around selected items. | |
579 | The value may have any of the forms acceptable to B<Tk_GetPixels>. | |
580 | ||
581 | =item Name: B<selectForeground> | |
582 | ||
583 | =item Class: B<Background> | |
584 | ||
585 | =item Switch: B<-selectforeground> | |
586 | ||
587 | Specifies the foreground color to use when displaying selected | |
588 | items. | |
589 | ||
590 | =item Name: B<setGrid> | |
591 | ||
592 | =item Class: B<SetGrid> | |
593 | ||
594 | =item Switch: B<-setgrid> | |
595 | ||
596 | Specifies a boolean value that determines whether this widget controls the | |
597 | resizing grid for its top-level window. | |
598 | This option is typically used in text widgets, where the information | |
599 | in the widget has a natural size (the size of a character) and it makes | |
600 | sense for the window's dimensions to be integral numbers of these units. | |
601 | These natural window sizes form a grid. | |
602 | If the B<setGrid> option is set to true then the widget will | |
603 | communicate with the window manager so that when the user interactively | |
604 | resizes the top-level window that contains the widget, the dimensions of | |
605 | the window will be displayed to the user in grid units and the window | |
606 | size will be constrained to integral numbers of grid units. | |
607 | See L<Tk::Wm/"GRIDDED GEOMETRY MANAGEMENT"> | |
608 | for more details. | |
609 | ||
610 | =item Name: B<takeFocus> | |
611 | ||
612 | =item Class: B<TakeFocus> | |
613 | ||
614 | =item Switch: B<-takefocus> | |
615 | ||
616 | Determines whether the window accepts the focus during keyboard | |
617 | traversal (e.g., Tab and Shift-Tab). | |
618 | Before setting the focus to a window, the traversal scripts | |
619 | consult the value of the B<takeFocus> option. | |
620 | A value of B<0> means that the window should be skipped entirely | |
621 | during keyboard traversal. | |
622 | B<1> means that the window should receive the input | |
623 | focus as long as it is viewable (it and all of its ancestors are mapped). | |
624 | An empty value for the option means that the traversal scripts make | |
625 | the decision about whether or not to focus on the window: the current | |
626 | algorithm is to skip the window if it is | |
627 | disabled, if it has no key bindings, or if it is not viewable. | |
628 | If the value has any other form, then the traversal scripts take | |
629 | the value, append the name of the window to it (with a separator space), | |
630 | and evaluate the resulting string as a Callback. | |
631 | The script must return B<0>, B<1>, or an empty string: a | |
632 | B<0> or B<1> value specifies whether the window will receive | |
633 | the input focus, and an empty string results in the default decision | |
634 | described above. | |
635 | Note: this interpretation of the option is defined entirely by | |
636 | the Callbacks that implement traversal: the widget implementations | |
637 | ignore the option entirely, so you can change its meaning if you | |
638 | redefine the keyboard traversal scripts. | |
639 | ||
640 | =item Name: B<text> | |
641 | ||
642 | =item Class: B<Text> | |
643 | ||
644 | =item Switch: B<-text> | |
645 | ||
646 | Specifies a string to be displayed inside the widget. The way in which | |
647 | the string is displayed depends on the particular widget and may be | |
648 | determined by other options, such as B<anchor> or B<justify>. | |
649 | ||
650 | =item Name: B<textVariable> | |
651 | ||
652 | =item Class: B<Variable> | |
653 | ||
654 | =item Switch: B<-textvariable> | |
655 | ||
656 | Specifies the name of a variable. The value of the variable is a text | |
657 | string to be displayed inside the widget; if the variable value changes | |
658 | then the widget will automatically update itself to reflect the new value. | |
659 | The way in which the string is displayed in the widget depends on the | |
660 | particular widget and may be determined by other options, such as | |
661 | B<anchor> or B<justify>. | |
662 | ||
663 | =item Name: B<troughColor> | |
664 | ||
665 | =item Class: B<Background> | |
666 | ||
667 | =item Switch: B<-troughcolor> | |
668 | ||
669 | Specifies the color to use for the rectangular trough areas | |
670 | in widgets such as scrollbars and scales. | |
671 | ||
672 | =item Name: B<troughTile> | |
673 | ||
674 | =item Class: B<Tile> | |
675 | ||
676 | =item Switch: B<-troughtile> | |
677 | ||
678 | Specifies image used to display in the rectangular trough areas | |
679 | in widgets such as scrollbars and scales. | |
680 | ||
681 | =item Name: B<underline> | |
682 | ||
683 | =item Class: B<Underline> | |
684 | ||
685 | =item Switch: B<-underline> | |
686 | ||
687 | Specifies the integer index of a character to underline in the widget. | |
688 | This option is used by the default bindings to implement keyboard | |
689 | traversal for menu buttons and menu entries. | |
690 | 0 corresponds to the first character of the text displayed in the | |
691 | widget, 1 to the next character, and so on. | |
692 | ||
693 | =item Name: B<wrapLength> | |
694 | ||
695 | =item Class: B<WrapLength> | |
696 | ||
697 | =item Switch: B<-wraplength> | |
698 | ||
699 | For widgets that can perform word-wrapping, this option specifies | |
700 | the maximum line length. | |
701 | Lines that would exceed this length are wrapped onto the next line, | |
702 | so that no line is longer than the specified length. | |
703 | The value may be specified in any of the standard forms for | |
704 | screen distances. | |
705 | If this value is less than or equal to 0 then no wrapping is done: lines | |
706 | will break only at newline characters in the text. | |
707 | ||
708 | =item Name: B<xScrollCommand> | |
709 | ||
710 | =item Class: B<ScrollCommand> | |
711 | ||
712 | =item Switch: B<-xscrollcommand> | |
713 | ||
714 | Specifies a callback used to communicate with horizontal | |
715 | scrollbars. | |
716 | When the view in the widget's window changes (or | |
717 | whenever anything else occurs that could change the display in a | |
718 | scrollbar, such as a change in the total size of the widget's | |
719 | contents), the widget will | |
720 | make a callback passing two numeric arguments in addition to | |
721 | any specified in the callback. | |
722 | Each of the numbers is a fraction between 0 and 1, which indicates | |
723 | a position in the document. 0 indicates the beginning of the document, | |
724 | 1 indicates the end, .333 indicates a position one third the way through | |
725 | the document, and so on. | |
726 | The first fraction indicates the first information in the document | |
727 | that is visible in the window, and the second fraction indicates | |
728 | the information just after the last portion that is visible. | |
729 | Typically the | |
730 | B<xScrollCommand> option consists of the scrollbar widget object | |
731 | and the method ``set'' i.e. [B<set> =E<gt> I<$sb>]: | |
732 | this will cause the scrollbar to be updated whenever the view in the window changes. | |
733 | If this option is not specified, then no command will be executed. | |
734 | ||
735 | =item Name: B<yScrollCommand> | |
736 | ||
737 | =item Class: B<ScrollCommand> | |
738 | ||
739 | =item Switch: B<-yscrollcommand> | |
740 | ||
741 | Specifies a calback used to communicate with vertical | |
742 | scrollbars. This option is treated in the same way as the | |
743 | B<xScrollCommand> option, except that it is used for vertical | |
744 | scrollbars and is provided by widgets that support vertical scrolling. | |
745 | See the description of B<xScrollCommand> for details | |
746 | on how this option is used. | |
747 | ||
748 | =back | |
749 | ||
750 | =head1 SEE ALSO | |
751 | ||
752 | L<Tk::option|Tk::option> | |
753 | L<Tk::callbacks|Tk::callbacks> | |
754 | L<Tk::configspec|Tk::configspec> | |
755 | L<Tk_GetPixels|Tk::pTk::GetPixels> | |
756 | ||
757 | =head1 KEYWORDS | |
758 | ||
759 | class, name, standard option, switch | |
760 | ||
761 | =cut | |
762 |