<manpage cat="widget" id="scrollbar" title="scrollbar" version="0.5">
<!-- This file was automatically generated.  DO NOT EDIT (yet)! -->
<!-- 
     SOURCE: tk/doc/scrollbar.n, r1.4
    
     Copyright (c) 1990-1994 The Regents of the University of California.
     Copyright (c) 1994-1996 Sun Microsystems, Inc.
     Copyright (c) 2004 Joe English
    
     See the file "license.terms" for information on usage and redistribution
     of this file, and for a DISCLAIMER OF ALL WARRANTIES.
     
     scrollbar.n,v 1.4 2006/11/27 05:45:02 jenglish Exp
 -->
<?TROFF.TH title="scrollbar" section="n" date="0.5" source="tile" manual="Tile Widget Set" ?>
<namesection>
<name>ttk::scrollbar</name>
<desc>Control the viewport of a scrollable widget</desc>
</namesection>
<synopsis>
<syntax>
<b>ttk::scrollbar</b> <m>pathName</m> ?<m>options...</m>?
</syntax>
</synopsis>
<section>
<title>STANDARD OPTIONS</title>
<sl cat="stdopt" cols="4">
<li>-class</li>
<li>-cursor</li>
<li>-style</li>
<li>-takefocus</li>
</sl>
</section>
<section>
<title>WIDGET-SPECIFIC OPTIONS</title>
<optionlist>
<optiondef>
<name>-command</name>
<dbname>command</dbname>
<dbclass>Command</dbclass>
<desc>A Tcl script prefix to evaluate 
to change the view in the widget associated with the scrollbar.
Additional arguments are appended to the value of this option,
as described in <ref refid="scrolling-commands">SCROLLING COMMANDS</ref> below,
whenever the user requests a view change by manipulating the scrollbar.
<br/>This option typically consists of a two-element list,
containing the name of a scrollable widget followed by
either <b>xview</b> (for horizontal scrollbars)
or <b>yview</b> (for vertical scrollbars).
</desc>
</optiondef>
<optiondef>
<name>-orient</name>
<dbname>orient</dbname>
<dbclass>Orient</dbclass>
<desc>One of <b>horizontal</b> or <b>vertical</b>.
Specifies the orientation of the scrollbar.
</desc>
</optiondef>
</optionlist>
</section>


<section>
<title>DESCRIPTION</title>
<p>Scrollbar widgets are typically linked to an associated window
that displays a document of some sort,
such as a file being edited or a drawing.
A scrollbar displays a <i>thumb</i> in the 
middle portion of the scrollbar,
whose position and size provides information 
about the portion of the document visible in
the associated window.
The thumb may be dragged by the user to control the
visible region.
Depending on the theme, two or more arrow buttons may also be present;
these are used to scroll the visible region in discrete units.
</p>
</section>
<section>
<title>WIDGET COMMAND</title>
<dl>
<dle>
<dt><m>pathName</m> <b>cget</b> <m>option</m></dt>
<dd>Returns the current value of the specified <i>option</i>; see <i>widget(n)</i>.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>configure</b> ?<m>option</m>? ?<m>value option value ...</m>?</dt>
<dd>Modify or query widget options; see <i>widget(n)</i>.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>get</b></dt>
<dd>Returns the scrollbar settings in the form of a list whose
elements are the arguments to the most recent <b cat="AMBIGUOUS ambiguous cmd">set</b> widget command.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>instate</b> <m>statespec</m> ?<m>script</m>?</dt>
<dd>Test the widget state; see <i>widget(n)</i>.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>set</b> <m>first last</m></dt>
<dd>This command is normally invoked by the scrollbar's associated widget 
from an <b>-xscrollcommand</b> or <b>-yscrollcommand</b> callback.
Specifies the visible range to be displayed.
<i>first</i> and <i>last</i> are real fractions between 0 and 1.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>state</b> ?<m>stateSpec</m>?</dt>
<dd>Modify or query the widget state; see <i>widget(n)</i>.
</dd>
</dle>
</dl>
</section>
<section>
<title>INTERNAL COMMANDS</title>
<p>The following widget commands are used internally
by the TScrollbar widget class bindings.
</p>
<dl>
<dle>
<dt><m>pathName</m> <b>delta</b> <m>deltaX deltaY</m></dt>
<dd>Returns a real number indicating the fractional change in
the scrollbar setting that corresponds to a given change
in thumb position.  For example, if the scrollbar is horizontal,
the result indicates how much the scrollbar setting must change
to move the thumb <i>deltaX</i> pixels to the right (<i>deltaY</i> is
ignored in this case).
If the scrollbar is vertical, the result indicates how much the
scrollbar setting must change to move the thumb <i>deltaY</i> pixels
down.  The arguments and the result may be zero or negative.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>fraction</b> <m>x y</m></dt>
<dd>Returns a real number between 0 and 1 indicating where the point
given by <i>x</i> and <i>y</i> lies in the trough area of the scrollbar,
where 0.0 corresponds to the top or left of the trough
and 1.0 corresponds to the bottom or right.
<i>X</i> and <i>y</i> are pixel coordinates relative to the scrollbar
widget.
If <i>x</i> and <i>y</i> refer to a point outside the trough, the closest
point in the trough is used.
</dd>
</dle>
<dle>
<dt><m>pathName</m> <b>identify</b> <m>x y</m></dt>
<dd>Returns the name of the element under the point given 
by <i>x</i> and <i>y</i>, or an empty string if the point does
not lie in any element of the scrollbar.
<i>X</i> and <i>y</i> are pixel coordinates relative to the scrollbar widget.
</dd>
</dle>
</dl>
</section>
<section id="scrolling-commands">
<title>SCROLLING COMMANDS</title>
<p>When the user interacts with the scrollbar, for example by dragging
the thumb, the scrollbar notifies the associated widget that it
must change its view.
The scrollbar makes the notification by evaluating a Tcl command
generated from the scrollbar's <b>-command</b> option.
The command may take any of the following forms.
In each case, <i>prefix</i> is the contents of the
<b>-command</b> option, which usually has a form like <b>.t yview</b>
</p>
<dl>
<dle>
<dt><m>prefix</m> <b>moveto</b> <m>fraction</m></dt>
<dd><i>Fraction</i> is a real number between 0 and 1.
The widget should adjust its view so that the point given
by <i>fraction</i> appears at the beginning of the widget.
If <i>fraction</i> is 0 it refers to the beginning of the
document.  1.0 refers to the end of the document, 0.333
refers to a point one-third of the way through the document,
and so on.
</dd>
</dle>
<dle>
<dt><m>prefix</m> <b>scroll</b> <m>number</m> <b>units</b></dt>
<dd>The widget should adjust its view by <i>number</i> units.
The units are defined in whatever way makes sense for the widget,
such as characters or lines in a text widget.
<i>Number</i> is either 1, which means one unit should scroll off
the top or left of the window, or -1, which means that one unit
should scroll off the bottom or right of the window.
</dd>
</dle>
<dle>
<dt><m>prefix</m> <b>scroll</b> <m>number</m> <b>pages</b></dt>
<dd>The widget should adjust its view by <i>number</i> pages.
It is up to the widget to define the meaning of a page;  typically
it is slightly less than what fits in the window, so that there
is a slight overlap between the old and new views.
<i>Number</i> is either 1, which means the next page should
become visible, or -1, which means that the previous page should
become visible.
</dd>
</dle>
</dl>
</section>
<section>
<title>WIDGET STATES</title>
<p>The scrollbar automatically sets the <b>disabled</b> state bit.
when the entire range is visible (range is 0.0 to 1.0),
and clears it otherwise.
It also sets the <b>active</b> and <b>pressed</b> state flags
of individual elements, based on the position and state of the mouse pointer.
</p>
</section>
<section>
<title>EXAMPLE</title>
<example>
set f [frame .f]
ttk::scrollbar $f.hsb -orient horizontal -command [list $f.t xview]
ttk::scrollbar $f.vsb -orient vertical -command [list $f.t yview]
text $f.t -xscrollcommand [list $f.hsb set] -yscrollcommand [list $f.vsb set] 
grid $f.t -row 0 -column 0 -sticky nsew
grid $f.vsb -row 0 -column 1 -sticky nsew
grid $f.hsb -row 1 -column 0 -sticky nsew
grid columnconfigure $f 0 -weight 1
grid rowconfigure $f 0 -weight 1
</example>
</section>
<keywords>
<keyword>scrollbar</keyword>
<keyword>widget</keyword>
</keywords>
</manpage>
