Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | '\" |
2 | '\" Copyright (c) 1990-1994 The Regents of the University of California. | |
3 | '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. | |
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: scrollbar.n,v 1.3.8.1 2004/10/28 12:25:22 dkf Exp $ | |
9 | '\" | |
10 | '\" The definitions below are for supplemental macros used in Tcl/Tk | |
11 | '\" manual entries. | |
12 | '\" | |
13 | '\" .AP type name in/out ?indent? | |
14 | '\" Start paragraph describing an argument to a library procedure. | |
15 | '\" type is type of argument (int, etc.), in/out is either "in", "out", | |
16 | '\" or "in/out" to describe whether procedure reads or modifies arg, | |
17 | '\" and indent is equivalent to second arg of .IP (shouldn't ever be | |
18 | '\" needed; use .AS below instead) | |
19 | '\" | |
20 | '\" .AS ?type? ?name? | |
21 | '\" Give maximum sizes of arguments for setting tab stops. Type and | |
22 | '\" name are examples of largest possible arguments that will be passed | |
23 | '\" to .AP later. If args are omitted, default tab stops are used. | |
24 | '\" | |
25 | '\" .BS | |
26 | '\" Start box enclosure. From here until next .BE, everything will be | |
27 | '\" enclosed in one large box. | |
28 | '\" | |
29 | '\" .BE | |
30 | '\" End of box enclosure. | |
31 | '\" | |
32 | '\" .CS | |
33 | '\" Begin code excerpt. | |
34 | '\" | |
35 | '\" .CE | |
36 | '\" End code excerpt. | |
37 | '\" | |
38 | '\" .VS ?version? ?br? | |
39 | '\" Begin vertical sidebar, for use in marking newly-changed parts | |
40 | '\" of man pages. The first argument is ignored and used for recording | |
41 | '\" the version when the .VS was added, so that the sidebars can be | |
42 | '\" found and removed when they reach a certain age. If another argument | |
43 | '\" is present, then a line break is forced before starting the sidebar. | |
44 | '\" | |
45 | '\" .VE | |
46 | '\" End of vertical sidebar. | |
47 | '\" | |
48 | '\" .DS | |
49 | '\" Begin an indented unfilled display. | |
50 | '\" | |
51 | '\" .DE | |
52 | '\" End of indented unfilled display. | |
53 | '\" | |
54 | '\" .SO | |
55 | '\" Start of list of standard options for a Tk widget. The | |
56 | '\" options follow on successive lines, in four columns separated | |
57 | '\" by tabs. | |
58 | '\" | |
59 | '\" .SE | |
60 | '\" End of list of standard options for a Tk widget. | |
61 | '\" | |
62 | '\" .OP cmdName dbName dbClass | |
63 | '\" Start of description of a specific option. cmdName gives the | |
64 | '\" option's name as specified in the class command, dbName gives | |
65 | '\" the option's name in the option database, and dbClass gives | |
66 | '\" the option's class in the option database. | |
67 | '\" | |
68 | '\" .UL arg1 arg2 | |
69 | '\" Print arg1 underlined, then print arg2 normally. | |
70 | '\" | |
71 | '\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $ | |
72 | '\" | |
73 | '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages. | |
74 | .if t .wh -1.3i ^B | |
75 | .nr ^l \n(.l | |
76 | .ad b | |
77 | '\" # Start an argument description | |
78 | .de AP | |
79 | .ie !"\\$4"" .TP \\$4 | |
80 | .el \{\ | |
81 | . ie !"\\$2"" .TP \\n()Cu | |
82 | . el .TP 15 | |
83 | .\} | |
84 | .ta \\n()Au \\n()Bu | |
85 | .ie !"\\$3"" \{\ | |
86 | \&\\$1 \\fI\\$2\\fP (\\$3) | |
87 | .\".b | |
88 | .\} | |
89 | .el \{\ | |
90 | .br | |
91 | .ie !"\\$2"" \{\ | |
92 | \&\\$1 \\fI\\$2\\fP | |
93 | .\} | |
94 | .el \{\ | |
95 | \&\\fI\\$1\\fP | |
96 | .\} | |
97 | .\} | |
98 | .. | |
99 | '\" # define tabbing values for .AP | |
100 | .de AS | |
101 | .nr )A 10n | |
102 | .if !"\\$1"" .nr )A \\w'\\$1'u+3n | |
103 | .nr )B \\n()Au+15n | |
104 | .\" | |
105 | .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n | |
106 | .nr )C \\n()Bu+\\w'(in/out)'u+2n | |
107 | .. | |
108 | .AS Tcl_Interp Tcl_CreateInterp in/out | |
109 | '\" # BS - start boxed text | |
110 | '\" # ^y = starting y location | |
111 | '\" # ^b = 1 | |
112 | .de BS | |
113 | .br | |
114 | .mk ^y | |
115 | .nr ^b 1u | |
116 | .if n .nf | |
117 | .if n .ti 0 | |
118 | .if n \l'\\n(.lu\(ul' | |
119 | .if n .fi | |
120 | .. | |
121 | '\" # BE - end boxed text (draw box now) | |
122 | .de BE | |
123 | .nf | |
124 | .ti 0 | |
125 | .mk ^t | |
126 | .ie n \l'\\n(^lu\(ul' | |
127 | .el \{\ | |
128 | .\" Draw four-sided box normally, but don't draw top of | |
129 | .\" box if the box started on an earlier page. | |
130 | .ie !\\n(^b-1 \{\ | |
131 | \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
132 | .\} | |
133 | .el \}\ | |
134 | \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul' | |
135 | .\} | |
136 | .\} | |
137 | .fi | |
138 | .br | |
139 | .nr ^b 0 | |
140 | .. | |
141 | '\" # VS - start vertical sidebar | |
142 | '\" # ^Y = starting y location | |
143 | '\" # ^v = 1 (for troff; for nroff this doesn't matter) | |
144 | .de VS | |
145 | .if !"\\$2"" .br | |
146 | .mk ^Y | |
147 | .ie n 'mc \s12\(br\s0 | |
148 | .el .nr ^v 1u | |
149 | .. | |
150 | '\" # VE - end of vertical sidebar | |
151 | .de VE | |
152 | .ie n 'mc | |
153 | .el \{\ | |
154 | .ev 2 | |
155 | .nf | |
156 | .ti 0 | |
157 | .mk ^t | |
158 | \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n' | |
159 | .sp -1 | |
160 | .fi | |
161 | .ev | |
162 | .\} | |
163 | .nr ^v 0 | |
164 | .. | |
165 | '\" # Special macro to handle page bottom: finish off current | |
166 | '\" # box/sidebar if in box/sidebar mode, then invoked standard | |
167 | '\" # page bottom macro. | |
168 | .de ^B | |
169 | .ev 2 | |
170 | 'ti 0 | |
171 | 'nf | |
172 | .mk ^t | |
173 | .if \\n(^b \{\ | |
174 | .\" Draw three-sided box if this is the box's first page, | |
175 | .\" draw two sides but no top otherwise. | |
176 | .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
177 | .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c | |
178 | .\} | |
179 | .if \\n(^v \{\ | |
180 | .nr ^x \\n(^tu+1v-\\n(^Yu | |
181 | \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c | |
182 | .\} | |
183 | .bp | |
184 | 'fi | |
185 | .ev | |
186 | .if \\n(^b \{\ | |
187 | .mk ^y | |
188 | .nr ^b 2 | |
189 | .\} | |
190 | .if \\n(^v \{\ | |
191 | .mk ^Y | |
192 | .\} | |
193 | .. | |
194 | '\" # DS - begin display | |
195 | .de DS | |
196 | .RS | |
197 | .nf | |
198 | .sp | |
199 | .. | |
200 | '\" # DE - end display | |
201 | .de DE | |
202 | .fi | |
203 | .RE | |
204 | .sp | |
205 | .. | |
206 | '\" # SO - start of list of standard options | |
207 | .de SO | |
208 | .SH "STANDARD OPTIONS" | |
209 | .LP | |
210 | .nf | |
211 | .ta 5.5c 11c | |
212 | .ft B | |
213 | .. | |
214 | '\" # SE - end of list of standard options | |
215 | .de SE | |
216 | .fi | |
217 | .ft R | |
218 | .LP | |
219 | See the \\fBoptions\\fR manual entry for details on the standard options. | |
220 | .. | |
221 | '\" # OP - start of full description for a single option | |
222 | .de OP | |
223 | .LP | |
224 | .nf | |
225 | .ta 4c | |
226 | Command-Line Name: \\fB\\$1\\fR | |
227 | Database Name: \\fB\\$2\\fR | |
228 | Database Class: \\fB\\$3\\fR | |
229 | .fi | |
230 | .IP | |
231 | .. | |
232 | '\" # CS - begin code excerpt | |
233 | .de CS | |
234 | .RS | |
235 | .nf | |
236 | .ta .25i .5i .75i 1i | |
237 | .. | |
238 | '\" # CE - end code excerpt | |
239 | .de CE | |
240 | .fi | |
241 | .RE | |
242 | .. | |
243 | .de UL | |
244 | \\$1\l'|0\(ul'\\$2 | |
245 | .. | |
246 | .TH scrollbar n 4.1 Tk "Tk Built-In Commands" | |
247 | .BS | |
248 | '\" Note: do not modify the .SH NAME line immediately below! | |
249 | .SH NAME | |
250 | scrollbar \- Create and manipulate scrollbar widgets | |
251 | .SH SYNOPSIS | |
252 | \fBscrollbar\fR \fIpathName \fR?\fIoptions\fR? | |
253 | .SO | |
254 | \-activebackground \-highlightcolor \-repeatdelay | |
255 | \-background \-highlightthickness \-repeatinterval | |
256 | \-borderwidth \-jump \-takefocus | |
257 | \-cursor \-orient \-troughcolor | |
258 | \-highlightbackground \-relief | |
259 | .SE | |
260 | .SH "WIDGET-SPECIFIC OPTIONS" | |
261 | .OP \-activerelief activeRelief ActiveRelief | |
262 | Specifies the relief to use when displaying the element that is | |
263 | active, if any. | |
264 | Elements other than the active element are always displayed with | |
265 | a raised relief. | |
266 | .OP \-command command Command | |
267 | Specifies the prefix of a Tcl command to invoke to change the view | |
268 | in the widget associated with the scrollbar. When a user requests | |
269 | a view change by manipulating the scrollbar, a Tcl command is | |
270 | invoked. The actual command consists of this option followed by | |
271 | additional information as described later. This option almost always has | |
272 | a value such as \fB.t xview\fR or \fB.t yview\fR, consisting of the | |
273 | name of a widget and either \fBxview\fR (if the scrollbar is for | |
274 | horizontal scrolling) or \fByview\fR (for vertical scrolling). | |
275 | All scrollable widgets have \fBxview\fR and \fByview\fR commands | |
276 | that take exactly the additional arguments appended by the scrollbar | |
277 | as described in SCROLLING COMMANDS below. | |
278 | .OP \-elementborderwidth elementBorderWidth BorderWidth | |
279 | Specifies the width of borders drawn around the internal elements | |
280 | of the scrollbar (the two arrows and the slider). The value may | |
281 | have any of the forms acceptable to \fBTk_GetPixels\fR. | |
282 | If this value is less than zero, the value of the \fBborderWidth\fR | |
283 | option is used in its place. | |
284 | .OP \-width width Width | |
285 | Specifies the desired narrow dimension of the scrollbar window, | |
286 | not including 3-D border, if any. For vertical | |
287 | scrollbars this will be the width and for horizontal scrollbars | |
288 | this will be the height. | |
289 | The value may have any of the forms acceptable to \fBTk_GetPixels\fR. | |
290 | .BE | |
291 | ||
292 | .SH DESCRIPTION | |
293 | .PP | |
294 | The \fBscrollbar\fR command creates a new window (given by the | |
295 | \fIpathName\fR argument) and makes it into a scrollbar widget. | |
296 | Additional options, described above, may be specified on the command | |
297 | line or in the option database to configure aspects of the scrollbar | |
298 | such as its colors, orientation, and relief. | |
299 | The \fBscrollbar\fR command returns its \fIpathName\fR argument. | |
300 | At the time this command is invoked, there must not exist a window | |
301 | named \fIpathName\fR, but \fIpathName\fR's parent must exist. | |
302 | .PP | |
303 | A scrollbar is a widget that displays two arrows, one at each end of | |
304 | the scrollbar, and a \fIslider\fR in the middle portion of the | |
305 | scrollbar. | |
306 | It provides information about what is visible in an \fIassociated window\fR | |
307 | that displays a document of some sort (such as a file being edited or | |
308 | a drawing). | |
309 | The position and size of the slider indicate which portion of the | |
310 | document is visible in the associated window. For example, if the | |
311 | slider in a vertical scrollbar covers the top third of the area | |
312 | between the two arrows, it means that the associated window displays | |
313 | the top third of its document. | |
314 | .PP | |
315 | Scrollbars can be used to adjust the view in the associated window | |
316 | by clicking or dragging with the mouse. See the \fBBINDINGS\fR section | |
317 | below for details. | |
318 | .SH "ELEMENTS" | |
319 | .PP | |
320 | A scrollbar displays five elements, which are referred to in the | |
321 | widget commands for the scrollbar: | |
322 | .TP 10 | |
323 | \fBarrow1\fR | |
324 | The top or left arrow in the scrollbar. | |
325 | .TP 10 | |
326 | \fBtrough1\fR | |
327 | The region between the slider and \fBarrow1\fR. | |
328 | .TP 10 | |
329 | \fBslider\fR | |
330 | The rectangle that indicates what is visible in the associated widget. | |
331 | .TP 10 | |
332 | \fBtrough2\fR | |
333 | The region between the slider and \fBarrow2\fR. | |
334 | .TP 10 | |
335 | \fBarrow2\fR | |
336 | The bottom or right arrow in the scrollbar. | |
337 | .SH "WIDGET COMMAND" | |
338 | .PP | |
339 | The \fBscrollbar\fR command creates a new Tcl command whose | |
340 | name is \fIpathName\fR. This | |
341 | command may be used to invoke various | |
342 | operations on the widget. It has the following general form: | |
343 | .CS | |
344 | \fIpathName option \fR?\fIarg arg ...\fR? | |
345 | .CE | |
346 | \fIOption\fR and the \fIarg\fRs | |
347 | determine the exact behavior of the command. The following | |
348 | commands are possible for scrollbar widgets: | |
349 | .TP | |
350 | \fIpathName \fBactivate \fR?\fIelement\fR? | |
351 | Marks the element indicated by \fIelement\fR as active, which | |
352 | causes it to be displayed as specified by the \fBactiveBackground\fR | |
353 | and \fBactiveRelief\fR options. | |
354 | The only element values understood by this command are \fBarrow1\fR, | |
355 | \fBslider\fR, or \fBarrow2\fR. | |
356 | If any other value is specified then no element of the scrollbar | |
357 | will be active. | |
358 | If \fIelement\fR is not specified, the command returns | |
359 | the name of the element that is currently active, or an empty string | |
360 | if no element is active. | |
361 | .TP | |
362 | \fIpathName \fBcget\fR \fIoption\fR | |
363 | Returns the current value of the configuration option given | |
364 | by \fIoption\fR. | |
365 | \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR | |
366 | command. | |
367 | .TP | |
368 | \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR? | |
369 | Query or modify the configuration options of the widget. | |
370 | If no \fIoption\fR is specified, returns a list describing all of | |
371 | the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for | |
372 | information on the format of this list). If \fIoption\fR is specified | |
373 | with no \fIvalue\fR, then the command returns a list describing the | |
374 | one named option (this list will be identical to the corresponding | |
375 | sublist of the value returned if no \fIoption\fR is specified). If | |
376 | one or more \fIoption\-value\fR pairs are specified, then the command | |
377 | modifies the given widget option(s) to have the given value(s); in | |
378 | this case the command returns an empty string. | |
379 | \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR | |
380 | command. | |
381 | .TP | |
382 | \fIpathName \fBdelta \fIdeltaX deltaY\fR | |
383 | Returns a real number indicating the fractional change in | |
384 | the scrollbar setting that corresponds to a given change | |
385 | in slider position. For example, if the scrollbar is horizontal, | |
386 | the result indicates how much the scrollbar setting must change | |
387 | to move the slider \fIdeltaX\fR pixels to the right (\fIdeltaY\fR is | |
388 | ignored in this case). | |
389 | If the scrollbar is vertical, the result indicates how much the | |
390 | scrollbar setting must change to move the slider \fIdeltaY\fR pixels | |
391 | down. The arguments and the result may be zero or negative. | |
392 | .TP | |
393 | \fIpathName \fBfraction \fIx y\fR | |
394 | Returns a real number between 0 and 1 indicating where the point | |
395 | given by \fIx\fR and \fIy\fR lies in the trough area of the scrollbar. | |
396 | The value 0 corresponds to the top or left of the trough, the | |
397 | value 1 corresponds to the bottom or right, 0.5 corresponds to | |
398 | the middle, and so on. | |
399 | \fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar | |
400 | widget. | |
401 | If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest | |
402 | point in the trough is used. | |
403 | .TP | |
404 | \fIpathName \fBget\fR | |
405 | Returns the scrollbar settings in the form of a list whose | |
406 | elements are the arguments to the most recent \fBset\fR widget command. | |
407 | .TP | |
408 | \fIpathName \fBidentify\fR \fIx y\fR | |
409 | Returns the name of the element under the point given by \fIx\fR and | |
410 | \fIy\fR (such as \fBarrow1\fR), or an empty string if the point does | |
411 | not lie in any element of the scrollbar. | |
412 | \fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar | |
413 | widget. | |
414 | .TP | |
415 | \fIpathName \fBset\fR \fIfirst last\fR | |
416 | This command is invoked by the scrollbar's associated widget to | |
417 | tell the scrollbar about the current view in the widget. | |
418 | The command takes two arguments, each of which is a real fraction | |
419 | between 0 and 1. | |
420 | The fractions describe the range of the document that is visible in | |
421 | the associated widget. | |
422 | For example, if \fIfirst\fR is 0.2 and \fIlast\fR is 0.4, it means | |
423 | that the first part of the document visible in the window is 20% | |
424 | of the way through the document, and the last visible part is 40% | |
425 | of the way through. | |
426 | .SH "SCROLLING COMMANDS" | |
427 | .PP | |
428 | When the user interacts with the scrollbar, for example by dragging | |
429 | the slider, the scrollbar notifies the associated widget that it | |
430 | must change its view. | |
431 | The scrollbar makes the notification by evaluating a Tcl command | |
432 | generated from the scrollbar's \fB\-command\fR option. | |
433 | The command may take any of the following forms. | |
434 | In each case, \fIprefix\fR is the contents of the | |
435 | \fB\-command\fR option, which usually has a form like \fB.t yview\fR | |
436 | .TP | |
437 | \fIprefix \fBmoveto \fIfraction\fR | |
438 | \fIFraction\fR is a real number between 0 and 1. | |
439 | The widget should adjust its view so that the point given | |
440 | by \fIfraction\fR appears at the beginning of the widget. | |
441 | If \fIfraction\fR is 0 it refers to the beginning of the | |
442 | document. 1.0 refers to the end of the document, 0.333 | |
443 | refers to a point one-third of the way through the document, | |
444 | and so on. | |
445 | .TP | |
446 | \fIprefix \fBscroll \fInumber \fBunits\fR | |
447 | The widget should adjust its view by \fInumber\fR units. | |
448 | The units are defined in whatever way makes sense for the widget, | |
449 | such as characters or lines in a text widget. | |
450 | \fINumber\fR is either 1, which means one unit should scroll off | |
451 | the top or left of the window, or \-1, which means that one unit | |
452 | should scroll off the bottom or right of the window. | |
453 | .TP | |
454 | \fIprefix \fBscroll \fInumber \fBpages\fR | |
455 | The widget should adjust its view by \fInumber\fR pages. | |
456 | It is up to the widget to define the meaning of a page; typically | |
457 | it is slightly less than what fits in the window, so that there | |
458 | is a slight overlap between the old and new views. | |
459 | \fINumber\fR is either 1, which means the next page should | |
460 | become visible, or \-1, which means that the previous page should | |
461 | become visible. | |
462 | .SH "OLD COMMAND SYNTAX" | |
463 | .PP | |
464 | In versions of Tk before 4.0, the \fBset\fR and \fBget\fR widget | |
465 | commands used a different form. | |
466 | This form is still supported for backward compatibility, but it | |
467 | is deprecated. | |
468 | In the old command syntax, the \fBset\fR widget command has the | |
469 | following form: | |
470 | .TP | |
471 | \fIpathName \fBset\fR \fItotalUnits windowUnits firstUnit lastUnit\fR | |
472 | In this form the arguments are all integers. | |
473 | \fITotalUnits\fR gives the total size of the object being displayed in the | |
474 | associated widget. The meaning of one unit depends on the associated | |
475 | widget; for example, in a text editor widget units might | |
476 | correspond to lines of | |
477 | text. \fIWindowUnits\fR indicates the total number of units that | |
478 | can fit in the associated window at one time. \fIFirstUnit\fR | |
479 | and \fIlastUnit\fR give the indices of the first and last units | |
480 | currently visible in the associated window (zero corresponds to the | |
481 | first unit of the object). | |
482 | .LP | |
483 | Under the old syntax the \fBget\fR widget command returns a list | |
484 | of four integers, consisting of the \fItotalUnits\fR, \fIwindowUnits\fR, | |
485 | \fIfirstUnit\fR, and \fIlastUnit\fR values from the last \fBset\fR | |
486 | widget command. | |
487 | .PP | |
488 | The commands generated by scrollbars also have a different form | |
489 | when the old syntax is being used: | |
490 | .TP | |
491 | \fIprefix\fR \fIunit\fR | |
492 | \fIUnit\fR is an integer that indicates what should appear at | |
493 | the top or left of the associated widget's window. | |
494 | It has the same meaning as the \fIfirstUnit\fR and \fIlastUnit\fR | |
495 | arguments to the \fBset\fR widget command. | |
496 | .LP | |
497 | The most recent \fBset\fR widget command determines whether or not | |
498 | to use the old syntax. | |
499 | If it is given two real arguments then the new syntax will be | |
500 | used in the future, and if it is given four integer arguments then | |
501 | the old syntax will be used. | |
502 | .SH BINDINGS | |
503 | Tk automatically creates class bindings for scrollbars that give them | |
504 | the following default behavior. | |
505 | If the behavior is different for vertical and horizontal scrollbars, | |
506 | the horizontal behavior is described in parentheses. | |
507 | .IP [1] | |
508 | Pressing button 1 over \fBarrow1\fR causes the view in the | |
509 | associated widget to shift up (left) by one unit so that the | |
510 | document appears to move down (right) one unit. | |
511 | If the button is held down, the action auto-repeats. | |
512 | .IP [2] | |
513 | Pressing button 1 over \fBtrough1\fR causes the view in the | |
514 | associated widget to shift up (left) by one screenful so that the | |
515 | document appears to move down (right) one screenful. | |
516 | If the button is held down, the action auto-repeats. | |
517 | .IP [3] | |
518 | Pressing button 1 over the slider and dragging causes the view | |
519 | to drag with the slider. | |
520 | If the \fBjump\fR option is true, then the view doesn't drag along | |
521 | with the slider; it changes only when the mouse button is released. | |
522 | .IP [4] | |
523 | Pressing button 1 over \fBtrough2\fR causes the view in the | |
524 | associated widget to shift down (right) by one screenful so that the | |
525 | document appears to move up (left) one screenful. | |
526 | If the button is held down, the action auto-repeats. | |
527 | .IP [5] | |
528 | Pressing button 1 over \fBarrow2\fR causes the view in the | |
529 | associated widget to shift down (right) by one unit so that the | |
530 | document appears to move up (left) one unit. | |
531 | If the button is held down, the action auto-repeats. | |
532 | .IP [6] | |
533 | If button 2 is pressed over the trough or the slider, it sets | |
534 | the view to correspond to the mouse position; dragging the | |
535 | mouse with button 2 down causes the view to drag with the mouse. | |
536 | If button 2 is pressed over one of the arrows, it causes the | |
537 | same behavior as pressing button 1. | |
538 | .IP [7] | |
539 | If button 1 is pressed with the Control key down, then if the | |
540 | mouse is over \fBarrow1\fR or \fBtrough1\fR the view changes | |
541 | to the very top (left) of the document; if the mouse is over | |
542 | \fBarrow2\fR or \fBtrough2\fR the view changes | |
543 | to the very bottom (right) of the document; if the mouse is | |
544 | anywhere else then the button press has no effect. | |
545 | .IP [8] | |
546 | In vertical scrollbars the Up and Down keys have the same behavior | |
547 | as mouse clicks over \fBarrow1\fR and \fBarrow2\fR, respectively. | |
548 | In horizontal scrollbars these keys have no effect. | |
549 | .IP [9] | |
550 | In vertical scrollbars Control-Up and Control-Down have the same | |
551 | behavior as mouse clicks over \fBtrough1\fR and \fBtrough2\fR, respectively. | |
552 | In horizontal scrollbars these keys have no effect. | |
553 | .IP [10] | |
554 | In horizontal scrollbars the Up and Down keys have the same behavior | |
555 | as mouse clicks over \fBarrow1\fR and \fBarrow2\fR, respectively. | |
556 | In vertical scrollbars these keys have no effect. | |
557 | .IP [11] | |
558 | In horizontal scrollbars Control-Up and Control-Down have the same | |
559 | behavior as mouse clicks over \fBtrough1\fR and \fBtrough2\fR, respectively. | |
560 | In vertical scrollbars these keys have no effect. | |
561 | .IP [12] | |
562 | The Prior and Next keys have the same behavior | |
563 | as mouse clicks over \fBtrough1\fR and \fBtrough2\fR, respectively. | |
564 | .IP [13] | |
565 | The Home key adjusts the view to the top (left edge) of the document. | |
566 | .IP [14] | |
567 | The End key adjusts the view to the bottom (right edge) of the document. | |
568 | .SH EXAMPLE | |
569 | Create a window with a scrollable \fBtext\fR widget: | |
570 | .CS | |
571 | toplevel .tl | |
572 | text .tl.t -yscrollcommand {.tl.s set} | |
573 | \fBscrollbar\fR .tl.s -command {.tl.t yview} | |
574 | grid .tl.t .tl.s -sticky nsew | |
575 | grid columnconfigure .tl 0 -weight 1 | |
576 | grid rowconfigure .tl 0 -weight 1 | |
577 | .CE | |
578 | ||
579 | .SH KEYWORDS | |
580 | scrollbar, widget |