Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::Scale.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "SCALE 1"
.TH SCALE 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
Tk::Scale \- Create and manipulate Scale widgets
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fI$scale\fR = \fI$parent\fR\->\fBScale\fR(?\fIoptions\fR?);
.SH "STANDARD OPTIONS"
.IX Header "STANDARD OPTIONS"
\&\fB\-activebackground\fR \fB\-font\fR \fB\-highlightthickness\fR \fB\-repeatinterval\fR
\&\fB\-background\fR \fB\-foreground\fR \fB\-orient\fR \fB\-takefocus\fR
\&\fB\-borderwidth\fR \fB\-highlightbackground\fR \fB\-relief\fR \fB\-troughcolor\fR
\&\fB\-cursor\fR \fB\-highlightcolor\fR \fB\-repeatdelay\fR
.PP
See Tk::options for details of the standard options.
.SH "WIDGET-SPECIFIC OPTIONS"
.IX Header "WIDGET-SPECIFIC OPTIONS"
.IP "Name: \fBbigIncrement\fR" 4
.IX Item "Name: bigIncrement"
.PD 0
.IP "Class: \fBBigIncrement\fR" 4
.IX Item "Class: BigIncrement"
.IP "Switch: \fB\-bigincrement\fR" 4
.IX Item "Switch: -bigincrement"
.PD
Some interactions with the scale cause its value to change by
``large'' increments; this option specifies the size of the
large increments. If specified as 0, the large increments default
to 1/10 the range of the scale.
.IP "Name: \fBcommand\fR" 4
.IX Item "Name: command"
.PD 0
.IP "Class: \fBCommand\fR" 4
.IX Item "Class: Command"
.IP "Switch: \fB\-command\fR" 4
.IX Item "Switch: -command"
.PD
Specifies the prefix of a perl/Tk callback to invoke whenever the scale's
value is changed via a method.
The actual command consists
of this option followed by a space and a real number indicating the
new value of the scale.
.IP "Name: \fBdigits\fR" 4
.IX Item "Name: digits"
.PD 0
.IP "Class: \fBDigits\fR" 4
.IX Item "Class: Digits"
.IP "Switch: \fB\-digits\fR" 4
.IX Item "Switch: -digits"
.PD
An integer specifying how many significant digits should be retained
when converting the value of the scale to a string.
If the number is less than or equal to zero, then the scale picks
the smallest value that guarantees that every possible slider
position prints as a different string.
.IP "Name: \fBfrom\fR" 4
.IX Item "Name: from"
.PD 0
.IP "Class: \fBFrom\fR" 4
.IX Item "Class: From"
.IP "Switch: \fB\-from\fR" 4
.IX Item "Switch: -from"
.PD
A real value corresponding to the left or top end of the scale.
.IP "Name: \fBlabel\fR" 4
.IX Item "Name: label"
.PD 0
.IP "Class: \fBLabel\fR" 4
.IX Item "Class: Label"
.IP "Switch: \fB\-label\fR" 4
.IX Item "Switch: -label"
.PD
A string to display as a label for the scale. For
vertical scales the label is displayed just to the right of the
top end of the scale. For horizontal scales the label is displayed
just above the left end of the scale. If the option is specified
as an empty string, no label is displayed.
.IP "Name: \fBlength\fR" 4
.IX Item "Name: length"
.PD 0
.IP "Class: \fBLength\fR" 4
.IX Item "Class: Length"
.IP "Switch: \fB\-length\fR" 4
.IX Item "Switch: -length"
.PD
Specifies the desired long dimension of the scale in screen units
(i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
For vertical scales this is the scale's height; for horizontal scales
it is the scale's width.
.IP "Name: \fBresolution\fR" 4
.IX Item "Name: resolution"
.PD 0
.IP "Class: \fBResolution\fR" 4
.IX Item "Class: Resolution"
.IP "Switch: \fB\-resolution\fR" 4
.IX Item "Switch: -resolution"
.PD
A real value specifying the resolution for the scale.
If this value is greater than zero then the scale's value will always be
rounded to an even multiple of this value, as will tick marks and
the endpoints of the scale. If the value is less than zero then no
rounding occurs. Defaults to 1 (i.e., the value will be integral).
.IP "Name: \fBshowValue\fR" 4
.IX Item "Name: showValue"
.PD 0
.IP "Class: \fBShowValue\fR" 4
.IX Item "Class: ShowValue"
.IP "Switch: \fB\-showvalue\fR" 4
.IX Item "Switch: -showvalue"
.PD
Specifies a boolean value indicating whether or not the current
value of the scale is to be displayed.
.IP "Name: \fBsliderLength\fR" 4
.IX Item "Name: sliderLength"
.PD 0
.IP "Class: \fBSliderLength\fR" 4
.IX Item "Class: SliderLength"
.IP "Switch: \fB\-sliderlength\fR" 4
.IX Item "Switch: -sliderlength"
.PD
Specfies the size of the slider, measured in screen units along the slider's
long dimension. The value may be specified in any of the forms acceptable
to \fBTk_GetPixels\fR.
.IP "Name: \fBsliderRelief\fR" 4
.IX Item "Name: sliderRelief"
.PD 0
.IP "Class: \fBSliderRelief\fR" 4
.IX Item "Class: SliderRelief"
.IP "Switch: \fB\-sliderrelief\fR" 4
.IX Item "Switch: -sliderrelief"
.PD
Specifies the relief to use when drawing the slider, such as \fBraised\fR
or \fBsunken\fR.
.IP "Name: \fBstate\fR" 4
.IX Item "Name: state"
.PD 0
.IP "Class: \fBState\fR" 4
.IX Item "Class: State"
.IP "Switch: \fB\-state\fR" 4
.IX Item "Switch: -state"
.PD
Specifies one of three states for the scale: \fBnormal\fR,
\&\fBactive\fR, or \fBdisabled\fR.
If the scale is disabled then the value may not be changed and the scale
won't activate.
If the scale is active, the slider is displayed using the color
specified by the \fBactiveBackground\fR option.
.IP "Name: \fBtickInterval\fR" 4
.IX Item "Name: tickInterval"
.PD 0
.IP "Class: \fBTickInterval\fR" 4
.IX Item "Class: TickInterval"
.IP "Switch: \fB\-tickinterval\fR" 4
.IX Item "Switch: -tickinterval"
.PD
Must be a real value.
Determines the spacing between numerical
tick marks displayed below or to the left of the slider.
If 0, no tick marks will be displayed.
.IP "Name: \fBto\fR" 4
.IX Item "Name: to"
.PD 0
.IP "Class: \fBTo\fR" 4
.IX Item "Class: To"
.IP "Switch: \fB\-to\fR" 4
.IX Item "Switch: -to"
.PD
Specifies a real value corresponding
to the right or bottom end of the scale.
This value may be either less than or greater than the \fBfrom\fR option.
.IP "Name: \fBvariable\fR" 4
.IX Item "Name: variable"
.PD 0
.IP "Class: \fBVariable\fR" 4
.IX Item "Class: Variable"
.IP "Switch: \fB\-variable\fR" 4
.IX Item "Switch: -variable"
.PD
Specifies the name of a global variable to link to the scale. Whenever the
value of the variable changes, the scale will update to reflect this
value.
Whenever the scale is manipulated interactively, the variable
will be modified to reflect the scale's new value.
.IP "Name: \fBwidth\fR" 4
.IX Item "Name: width"
.PD 0
.IP "Class: \fBWidth\fR" 4
.IX Item "Class: Width"
.IP "Switch: \fB\-width\fR" 4
.IX Item "Switch: -width"
.PD
Specifies the desired narrow dimension of the trough in screen units
(i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
For vertical scales this is the trough's width; for horizontal scales
this is the trough's height.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fBScale\fR method creates a new window (given by the
\&\f(CW$widget\fR argument) and makes it into a scale widget.
Additional
options, described above, may be specified on the command line
or in the option database
to configure aspects of the scale such as its colors, orientation,
and relief. The \fBscale\fR command returns its
\&\f(CW$widget\fR argument. At the time this command is invoked,
there must not exist a window named \f(CW$widget\fR, but
\&\f(CW$widget\fR's parent must exist.
.PP
A scale is a widget that displays a rectangular \fItrough\fR and a
small \fIslider\fR. The trough corresponds to a range
of real values (determined by the \fBfrom\fR, \fBto\fR, and
\&\fBresolution\fR options),
and the position of the slider selects a particular real value.
The slider's position (and hence the scale's value) may be adjusted
with the mouse or keyboard as described in
the \*(L"\s-1BINDINGS\s0\*(R" section below. Whenever the scale's value is changed, a Tcl
command is invoked (using the \fBcommand\fR option) to notify
other interested widgets of the change.
In addition, the value
of the scale can be linked to a Tcl variable (using the \fBvariable\fR
option), so that changes in either are reflected in the other.
.PP
Three annotations may be displayed in a scale widget: a label
appearing at the top right of the widget (top left for horizontal
scales), a number displayed just to the left of the slider
(just above the slider for horizontal scales), and a collection
of numerical tick marks just to the left of the current value
(just below the trough for horizontal scales). Each of these three
annotations may be enabled or disabled using the
configuration options.
.SH "WIDGET METHODS"
.IX Header "WIDGET METHODS"
The \fBScale\fR method creates a widget object.
This object supports the \fBconfigure\fR and \fBcget\fR methods
described in Tk::options which can be used to enquire and
modify the options described above.
The widget also inherits all the methods provided by the generic
Tk::Widget class.
.PP
The following additional methods are available for scale widgets:
.IP "\fI$scale\fR\->\fBcoords\fR(?\fIvalue\fR?)" 4
.IX Item "$scale->coords(?value?)"
Returns a list whose elements are the x and y coordinates of
the point along the centerline of the trough that corresponds
to \fIvalue\fR.
If \fIvalue\fR is omitted then the scale's current value is used.
.IP "\fI$scale\fR\->\fBget\fR(?\fIx, y\fR?)" 4
.IX Item "$scale->get(?x, y?)"
If \fIx\fR and \fIy\fR are omitted, returns the current value
of the scale. If \fIx\fR and \fIy\fR are specified, they give
pixel coordinates within the widget; the command returns
the scale value corresponding to the given pixel.
Only one of \fIx\fR or \fIy\fR is used: for horizontal scales
\&\fIy\fR is ignored, and for vertical scales \fIx\fR is ignored.
.IP "\fI$scale\fR\->\fBidentify\fR(\fIx, y\fR)" 4
.IX Item "$scale->identify(x, y)"
Returns a string indicating what part of the scale lies under
the coordinates given by \fIx\fR and \fIy\fR.
A return value of \fBslider\fR means that the point is over
the slider; \fBtrough1\fR means that the point is over the
portion of the slider above or to the left of the slider;
and \fBtrough2\fR means that the point is over the portion
of the slider below or to the right of the slider.
If the point isn't over one of these elements, an empty string
is returned.
.IP "\fI$scale\fR\->\fBset\fR(\fIvalue\fR)" 4
.IX Item "$scale->set(value)"
This command is invoked to change the current value of the scale,
and hence the position at which the slider is displayed. \fIValue\fR
gives the new value for the scale.
The command has no effect if the scale is disabled.
.SH "BINDINGS"
.IX Header "BINDINGS"
Tk automatically creates class bindings for scales that give them
the following default behavior.
Where the behavior is different for vertical and horizontal scales,
the horizontal behavior is described in parentheses.
.IP "[1]" 4
.IX Item "[1]"
If button 1 is pressed in the trough, the scale's value will
be incremented or decremented by the value of the \fBresolution\fR
option so that the slider moves in the direction of the cursor.
If the button is held down, the action auto\-repeats.
.IP "[2]" 4
.IX Item "[2]"
If button 1 is pressed over the slider, the slider can be dragged
with the mouse.
.IP "[3]" 4
.IX Item "[3]"
If button 1 is pressed in the trough with the Control key down,
the slider moves all the way to the end of its range, in the
direction towards the mouse cursor.
.IP "[4]" 4
.IX Item "[4]"
If button 2 is pressed, the scale's value is set to the mouse
position. If the mouse is dragged with button 2 down, the scale's
value changes with the drag.
.IP "[5]" 4
.IX Item "[5]"
The Up and Left keys move the slider up (left) by the value
of the \fBresolution\fR option.
.IP "[6]" 4
.IX Item "[6]"
The Down and Right keys move the slider down (right) by the value
of the \fBresolution\fR option.
.IP "[7]" 4
.IX Item "[7]"
Control-Up and Control-Left move the slider up (left) by the
value of the \fBbigIncrement\fR option.
.IP "[8]" 4
.IX Item "[8]"
Control-Down and Control-Right move the slider down (right) by the
value of the \fBbigIncrement\fR option.
.IP "[9]" 4
.IX Item "[9]"
Home moves the slider to the top (left) end of its range.
.IP "[10]" 4
.IX Item "[10]"
End moves the slider to the bottom (right) end of its range.
.Sp
If the scale is disabled using the \fBstate\fR option then
none of the above bindings have any effect.
.Sp
The behavior of scales can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH "KEYWORDS"
.IX Header "KEYWORDS"
scale, slider, trough, widget