Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Scrollbar.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "SCROLLBAR 1"
132.TH SCROLLBAR 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::Scrollbar \- Create and manipulate Scrollbar widgets
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137\&\fI$scrollbar\fR = \fI$parent\fR\->\fBScrollbar\fR(?\fIoptions\fR?);
138.SH "STANDARD OPTIONS"
139.IX Header "STANDARD OPTIONS"
140\&\fB\-activebackground\fR \fB\-highlightbackground\fR \fB\-orient\fR \fB\-takefocus\fR
141\&\fB\-background\fR \fB\-highlightcolor\fR \fB\-relief\fR \fB\-troughcolor\fR
142\&\fB\-borderwidth\fR \fB\-highlightthickness\fR \fB\-repeatdelay\fR
143\&\fB\-cursor\fR \fB\-jump\fR \fB\-repeatinterval\fR
144.PP
145See Tk::options for details of the standard options.
146.SH "WIDGET-SPECIFIC OPTIONS"
147.IX Header "WIDGET-SPECIFIC OPTIONS"
148.IP "Name: \fBactiveRelief\fR" 4
149.IX Item "Name: activeRelief"
150.PD 0
151.IP "Class: \fBActiveRelief\fR" 4
152.IX Item "Class: ActiveRelief"
153.IP "Switch: \fB\-activerelief\fR" 4
154.IX Item "Switch: -activerelief"
155.PD
156Specifies the relief to use when displaying the element that is
157active, if any.
158Elements other than the active element are always displayed with
159a raised relief.
160.IP "Name: \fBcommand\fR" 4
161.IX Item "Name: command"
162.PD 0
163.IP "Class: \fBCommand\fR" 4
164.IX Item "Class: Command"
165.IP "Switch: \fB\-command\fR" 4
166.IX Item "Switch: -command"
167.PD
168Specifies a callback to invoke to change the view
169in the widget associated with the scrollbar. When a user requests
170a view change by manipulating the scrollbar, the callback is
171invoked. The callback is passed
172additional arguments as described later. This option almost always has
173a value such as \fB[xview => \f(CB$widget\fB]\fR or \fB[yview => \f(CB$widget\fB]\fR, consisting of the
174a widget object and either \fBxview\fR (if the scrollbar is for
175horizontal scrolling) or \fByview\fR (for vertical scrolling).
176All scrollable widgets have \fBxview\fR and \fByview\fR methods
177that take exactly the additional arguments appended by the scrollbar
178as described in \*(L"\s-1SCROLLING\s0 \s-1COMMANDS\s0\*(R" below.
179.IP "Name: \fBelementBorderWidth\fR" 4
180.IX Item "Name: elementBorderWidth"
181.PD 0
182.IP "Class: \fBBorderWidth\fR" 4
183.IX Item "Class: BorderWidth"
184.IP "Switch: \fB\-elementborderwidth\fR" 4
185.IX Item "Switch: -elementborderwidth"
186.PD
187Specifies the width of borders drawn around the internal elements
188of the scrollbar (the two arrows and the slider). The value may
189have any of the forms acceptable to \fBTk_GetPixels\fR.
190If this value is less than zero, the value of the \fBborderWidth\fR
191option is used in its place.
192.IP "Name: \fBwidth\fR" 4
193.IX Item "Name: width"
194.PD 0
195.IP "Class: \fBWidth\fR" 4
196.IX Item "Class: Width"
197.IP "Switch: \fB\-width\fR" 4
198.IX Item "Switch: -width"
199.PD
200Specifies the desired narrow dimension of the scrollbar window,
201not including 3\-D border, if any. For vertical
202scrollbars this will be the width and for horizontal scrollbars
203this will be the height.
204The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
205.SH "DESCRIPTION"
206.IX Header "DESCRIPTION"
207The \fBScrollbar\fR method creates a new window (given by the
208\&\f(CW$widget\fR argument) and makes it into a scrollbar widget.
209Additional options, described above, may be specified on the command
210line or in the option database to configure aspects of the scrollbar
211such as its colors, orientation, and relief.
212The \fBscrollbar\fR command returns its \f(CW$widget\fR argument.
213At the time this command is invoked, there must not exist a window
214named \f(CW$widget\fR, but \f(CW$widget\fR's parent must exist.
215.PP
216A scrollbar is a widget that displays two arrows, one at each end of
217the scrollbar, and a \fIslider\fR in the middle portion of the
218scrollbar.
219It provides information about what is visible in an \fIassociated window\fR
220that displays an document of some sort (such as a file being edited or
221a drawing).
222The position and size of the slider indicate which portion of the
223document is visible in the associated window. For example, if the
224slider in a vertical scrollbar covers the top third of the area
225between the two arrows, it means that the associated window displays
226the top third of its document.
227.PP
228Scrollbars can be used to adjust the view in the associated window
229by clicking or dragging with the mouse.
230See \*(L"\s-1BINDINGS\s0\*(R" below for details.
231.SH "ELEMENTS"
232.IX Header "ELEMENTS"
233A scrollbar displays five elements, which are referred to in the
234methods for the scrollbar:
235.IP "\fBarrow1\fR" 4
236.IX Item "arrow1"
237The top or left arrow in the scrollbar.
238.IP "\fBtrough1\fR" 4
239.IX Item "trough1"
240The region between the slider and \fBarrow1\fR.
241.IP "\fBslider\fR" 4
242.IX Item "slider"
243The rectangle that indicates what is visible in the associated widget.
244.IP "\fBtrough2\fR" 4
245.IX Item "trough2"
246The region between the slider and \fBarrow2\fR.
247.IP "\fBarrow2\fR" 4
248.IX Item "arrow2"
249The bottom or right arrow in the scrollbar.
250.SH "WIDGET METHODS"
251.IX Header "WIDGET METHODS"
252The \fBScrollbar\fR method creates a widget object.
253This object supports the \fBconfigure\fR and \fBcget\fR methods
254described in Tk::options which can be used to enquire and
255modify the options described above.
256The widget also inherits all the methods provided by the generic
257Tk::Widget class.
258.PP
259The following additional methods are available for scrollbar widgets:
260.IP "\fI$scrollbar\fR\->\fBactivate\fR(?\fIelement\fR?)" 4
261.IX Item "$scrollbar->activate(?element?)"
262Marks the element indicated by \fIelement\fR as active, which
263causes it to be displayed as specified by the \fBactiveBackground\fR
264and \fBactiveRelief\fR options.
265The only element values understood by this command are \fBarrow1\fR,
266\&\fBslider\fR, or \fBarrow2\fR.
267If any other value is specified then no element of the scrollbar
268will be active.
269If \fIelement\fR is not specified, the command returns
270the name of the element that is currently active, or an empty string
271if no element is active.
272.IP "\fI$scrollbar\fR\->\fBdelta\fR(\fIdeltaX, deltaY\fR)" 4
273.IX Item "$scrollbar->delta(deltaX, deltaY)"
274Returns a real number indicating the fractional change in
275the scrollbar setting that corresponds to a given change
276in slider position. For example, if the scrollbar is horizontal,
277the result indicates how much the scrollbar setting must change
278to move the slider \fIdeltaX\fR pixels to the right (\fIdeltaY\fR is
279ignored in this case).
280If the scrollbar is vertical, the result indicates how much the
281scrollbar setting must change to move the slider \fIdeltaY\fR pixels
282down. The arguments and the result may be zero or negative.
283.IP "\fI$scrollbar\fR\->\fBfraction\fR(\fIx, y\fR)" 4
284.IX Item "$scrollbar->fraction(x, y)"
285Returns a real number between 0 and 1 indicating where the point
286given by \fIx\fR and \fIy\fR lies in the trough area of the scrollbar.
287The value 0 corresponds to the top or left of the trough, the
288value 1 corresponds to the bottom or right, 0.5 corresponds to
289the middle, and so on.
290\&\fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar
291widget.
292If \fIx\fR and \fIy\fR refer to a point outside the trough, the closest
293point in the trough is used.
294.IP "\fI$scrollbar\fR\->\fBget\fR" 4
295.IX Item "$scrollbar->get"
296Returns the scrollbar settings in the form of a list whose
297elements are the arguments to the most recent \fBset\fR method.
298.IP "\fI$scrollbar\fR\->\fBidentify\fR(\fIx, y\fR)" 4
299.IX Item "$scrollbar->identify(x, y)"
300Returns the name of the element under the point given by \fIx\fR and
301\&\fIy\fR (such as \fBarrow1\fR), or an empty string if the point does
302not lie in any element of the scrollbar.
303\&\fIX\fR and \fIy\fR must be pixel coordinates relative to the scrollbar
304widget.
305.IP "\fI$scrollbar\fR\->\fBset\fR(\fIfirst, last\fR)" 4
306.IX Item "$scrollbar->set(first, last)"
307This command is invoked by the scrollbar's associated widget to
308tell the scrollbar about the current view in the widget.
309The command takes two arguments, each of which is a real fraction
310between 0 and 1.
311The fractions describe the range of the document that is visible in
312the associated widget.
313For example, if \fIfirst\fR is 0.2 and \fIlast\fR is 0.4, it means
314that the first part of the document visible in the window is 20%
315of the way through the document, and the last visible part is 40%
316of the way through.
317.SH "SCROLLING COMMANDS"
318.IX Header "SCROLLING COMMANDS"
319When the user interacts with the scrollbar, for example by dragging
320the slider, the scrollbar notifies the associated widget that it
321must change its view.
322The scrollbar makes the notification by evaluating a callback
323specified as the scrollbar's \fB\-command\fR option.
324The callback may take several forms.
325In each case, the intial arguments passed are those
326specified in the \fB\-command\fR callback itself,
327which usually has a form like [\fByview\fR => \fI$widget\fR].
328(Which will invoke \fI$widget\fR\->\fByview\fR(...) where
329the ... part is as below. See Tk::callbacks for details.)
330The callback is passed additional arguments as follows:
331.IP "\fBmoveto\fR,\fIfraction\fR" 4
332.IX Item "moveto,fraction"
333\&\fIFraction\fR is a real number between 0 and 1.
334The widget should adjust its view so that the point given
335by \fIfraction\fR appears at the beginning of the widget.
336If \fIfraction\fR is 0 it refers to the beginning of the
337document. 1.0 refers to the end of the document, 0.333
338refers to a point one-third of the way through the document,
339and so on.
340.IP "\fBscroll,\fR\fInumber,\fR\fBunits\fR" 4
341.IX Item "scroll,number,units"
342The widget should adjust its view by \fInumber\fR units.
343The units are defined in whatever way makes sense for the widget,
344such as characters or lines in a text widget.
345\&\fINumber\fR is either 1, which means one unit should scroll off
346the top or left of the window, or \-1, which means that one unit
347should scroll off the bottom or right of the window.
348.IP "\fBscroll\fR,\fInumber\fR,\fBpage\fR" 4
349.IX Item "scroll,number,page"
350The widget should adjust its view by \fInumber\fR pages.
351It is up to the widget to define the meaning of a page; typically
352it is slightly less than what fits in the window, so that there
353is a slight overlap between the old and new views.
354\&\fINumber\fR is either 1, which means the next page should
355become visible, or \-1, which means that the previous page should
356become visible.
357.SH "OLD COMMAND SYNTAX"
358.IX Header "OLD COMMAND SYNTAX"
359In versions of Tk before 4.0, the \fBset\fR and \fBget\fR widget
360commands used a different form.
361This form is still supported for backward compatibility, but it
362is deprecated.
363In the old command syntax, the \fBset\fR method has the
364following form:
365.IP "\fI$scrollbar\fR\->\fBset\fR(\fItotalUnits, windowUnits, firstUnit, lastUnit\fR)" 4
366.IX Item "$scrollbar->set(totalUnits, windowUnits, firstUnit, lastUnit)"
367In this form the arguments are all integers.
368\&\fITotalUnits\fR gives the total size of the object being displayed in the
369associated widget. The meaning of one unit depends on the associated
370widget; for example, in a text editor widget units might
371correspond to lines of
372text. \fIWindowUnits\fR indicates the total number of units that
373can fit in the associated window at one time. \fIFirstUnit\fR
374and \fIlastUnit\fR give the indices of the first and last units
375currently visible in the associated window (zero corresponds to the
376first unit of the object).
377.PP
378Under the old syntax the \fBget\fR method returns a list
379of four integers, consisting of the \fItotalUnits\fR, \fIwindowUnits\fR,
380\&\fIfirstUnit\fR, and \fIlastUnit\fR values from the last \fBset\fR
381method.
382.PP
383The callbacks generated by scrollbars also have a different form
384when the old syntax is being used, the callback is passed a single argument:
385.IP "\fIunit\fR" 4
386.IX Item "unit"
387\&\fIUnit\fR is an integer that indicates what should appear at
388the top or left of the associated widget's window.
389It has the same meaning as the \fIfirstUnit\fR and \fIlastUnit\fR
390arguments to the \fBset\fR method.
391.PP
392The most recent \fBset\fR method determines whether or not
393to use the old syntax.
394If it is given two real arguments then the new syntax will be
395used in the future, and if it is given four integer arguments then
396the old syntax will be used.
397.SH "BINDINGS"
398.IX Header "BINDINGS"
399Tk automatically creates class bindings for scrollbars that give them
400the following default behavior.
401If the behavior is different for vertical and horizontal scrollbars,
402the horizontal behavior is described in parentheses.
403.IP "[1]" 4
404.IX Item "[1]"
405Pressing button 1 over \fBarrow1\fR causes the view in the
406associated widget to shift up (left) by one unit so that the
407document appears to move down (right) one unit.
408If the button is held down, the action auto\-repeats.
409.IP "[2]" 4
410.IX Item "[2]"
411Pressing button 1 over \fBtrough1\fR causes the view in the
412associated widget to shift up (left) by one screenful so that the
413document appears to move down (right) one screenful.
414If the button is held down, the action auto\-repeats.
415.IP "[3]" 4
416.IX Item "[3]"
417Pressing button 1 over the slider and dragging causes the view
418to drag with the slider.
419If the \fBjump\fR option is true, then the view doesn't drag along
420with the slider; it changes only when the mouse button is released.
421.IP "[4]" 4
422.IX Item "[4]"
423Pressing button 1 over \fBtrough2\fR causes the view in the
424associated widget to shift down (right) by one screenful so that the
425document appears to move up (left) one screenful.
426If the button is held down, the action auto\-repeats.
427.IP "[5]" 4
428.IX Item "[5]"
429Pressing button 1 over \fBarrow2\fR causes the view in the
430associated widget to shift down (right) by one unit so that the
431document appears to move up (left) one unit.
432If the button is held down, the action auto\-repeats.
433.IP "[6]" 4
434.IX Item "[6]"
435If button 2 is pressed over the trough or the slider, it sets
436the view to correspond to the mouse position; dragging the
437mouse with button 2 down causes the view to drag with the mouse.
438If button 2 is pressed over one of the arrows, it causes the
439same behavior as pressing button 1.
440.IP "[7]" 4
441.IX Item "[7]"
442If button 1 is pressed with the Control key down, then if the
443mouse is over \fBarrow1\fR or \fBtrough1\fR the view changes
444to the very top (left) of the document; if the mouse is over
445\&\fBarrow2\fR or \fBtrough2\fR the view changes
446to the very bottom (right) of the document; if the mouse is
447anywhere else then the button press has no effect.
448.IP "[8]" 4
449.IX Item "[8]"
450In vertical scrollbars the Up and Down keys have the same behavior
451as mouse clicks over \fBarrow1\fR and \fBarrow2\fR, respectively.
452In horizontal scrollbars these keys have no effect.
453.IP "[9]" 4
454.IX Item "[9]"
455In vertical scrollbars Control-Up and Control-Down have the same
456behavior as mouse clicks over \fBtrough1\fR and \fBtrough2\fR, respectively.
457In horizontal scrollbars these keys have no effect.
458.IP "[10]" 4
459.IX Item "[10]"
460In horizontal scrollbars the Up and Down keys have the same behavior
461as mouse clicks over \fBarrow1\fR and \fBarrow2\fR, respectively.
462In vertical scrollbars these keys have no effect.
463.IP "[11]" 4
464.IX Item "[11]"
465In horizontal scrollbars Control-Up and Control-Down have the same
466behavior as mouse clicks over \fBtrough1\fR and \fBtrough2\fR, respectively.
467In vertical scrollbars these keys have no effect.
468.IP "[12]" 4
469.IX Item "[12]"
470The Prior and Next keys have the same behavior
471as mouse clicks over \fBtrough1\fR and \fBtrough2\fR, respectively.
472.IP "[13]" 4
473.IX Item "[13]"
474The Home key adjusts the view to the top (left edge) of the document.
475.IP "[14]" 4
476.IX Item "[14]"
477The End key adjusts the view to the bottom (right edge) of the document.
478.SH "SEE ALSO"
479.IX Header "SEE ALSO"
480Tk::callbacks
481Tk::Scrolled
482.SH "KEYWORDS"
483.IX Header "KEYWORDS"
484scrollbar, widget