1mNAME0m
       scrollbar - Create and manipulate scrollbar widgets

1mSYNOPSIS0m
       1mscrollbar 4m22mpathName24m ?4moptions24m?

1mSTANDARD OPTIONS0m
       1m-activebackground     -highlightcolor      -repeatdelay0m
       1m-background           -highlightthickness  -repeatinterval0m
       1m-borderwidth          -jump                -takefocus0m
       1m-cursor               -orient              -troughcolor0m
       1m-highlightbackground  -relief0m

       See the 1moptions 22mmanual entry for details on the standard options.

1mWIDGET-SPECIFIC OPTIONS0m
       Command-Line Name:1m-activerelief0m
       Database Name:  1mactiveRelief0m
       Database Class: 1mActiveRelief0m

              Specifies  the relief to use when displaying the element that is
              active, if any.  Elements other  than  the  active  element  are
              always displayed with a raised relief.

       Command-Line Name:1m-command0m
       Database Name:  1mcommand0m
       Database Class: 1mCommand0m

              Specifies  the  prefix  of a Tcl command to invoke to change the
              view in the widget associated with the scrollbar.  When  a  user
              requests a view change by manipulating the scrollbar, a Tcl com-
              mand is invoked.  The actual command  consists  of  this  option
              followed  by  additional  information  as described later.  This
              option almost always has a value such as 1m.t xview 22mor  1m.t  yview22m,
              consisting  of  the  name  of  a widget and either 1mxview 22m(if the
              scrollbar is for horizontal scrolling) or  1myview  22m(for  vertical
              scrolling).   All  scrollable  widgets have 1mxview 22mand 1myview 22mcom-
              mands that take exactly the additional arguments appended by the
              scrollbar as described in SCROLLING COMMANDS below.

       Command-Line Name:1m-elementborderwidth0m
       Database Name:  1melementBorderWidth0m
       Database Class: 1mBorderWidth0m

              Specifies  the  width  of borders drawn around the internal ele-
              ments of the scrollbar (the two arrows  and  the  slider).   The
              value  may have any of the forms acceptable to 1mTk_GetPixels22m.  If
              this value is less than  zero,  the  value  of  the  1mborderWidth0m
              option is used in its place.

       Command-Line Name:1m-width0m
       Database Name:  1mwidth0m
       Database Class: 1mWidth0m

              Specifies  the desired narrow dimension of the scrollbar window,
              not including 3-D border, if any.  For vertical scrollbars  this
              will be the width and for horizontal scrollbars this will be the
              height.  The value may have  any  of  the  forms  acceptable  to
              1mTk_GetPixels22m.


1mDESCRIPTION0m
       The 1mscrollbar 22mcommand creates a new window (given by the 4mpathName24m argu-
       ment) and makes  it  into  a  scrollbar  widget.   Additional  options,
       described  above, may be specified on the command line or in the option
       database to configure aspects of the scrollbar such as its colors, ori-
       entation, and relief.  The 1mscrollbar 22mcommand returns its 4mpathName24m argu-
       ment.  At the time this command is invoked, there must not exist a win-
       dow named 4mpathName24m, but 4mpathName24m's parent must exist.

       A  scrollbar  is  a widget that displays two arrows, one at each end of
       the scrollbar, and a 4mslider24m in the middle portion of the scrollbar.  It
       provides information about what is visible in an 4massociated24m 4mwindow24m that
       displays an document of some sort (such as a file  being  edited  or  a
       drawing).   The  position and size of the slider indicate which portion
       of the document is visible in the associated window.  For  example,  if
       the  slider  in  a  vertical scrollbar covers the top third of the area
       between the two arrows, it means that the  associated  window  displays
       the top third of its document.

       Scrollbars  can  be used to adjust the view in the associated window by
       clicking or dragging with the mouse.  See the  BINDINGS  section  below
       for details.


1mELEMENTS0m
       A scrollbar displays five elements, which are referred to in the widget
       commands for the scrollbar:

       1marrow1    22mThe top or left arrow in the scrollbar.

       1mtrough1   22mThe region between the slider and 1marrow122m.

       1mslider    22mThe rectangle that indicates what is visible in  the  associ-
                 ated widget.

       1mtrough2   22mThe region between the slider and 1marrow222m.

       1marrow2    22mThe bottom or right arrow in the scrollbar.


1mWIDGET COMMAND0m
       The 1mscrollbar 22mcommand creates a new Tcl command whose name is 4mpathName24m.
       This command may be used to invoke various operations  on  the  widget.
       It has the following general form:
              4mpathName24m 4moption24m ?4marg24m 4marg24m 4m...24m?
       4mOption24m  and  the 4marg24ms determine the exact behavior of the command.  The
       following commands are possible for scrollbar widgets:

       4mpathName24m 1mactivate 22m?4melement24m?
              Marks the element indicated by 4melement24m as active,  which  causes
              it  to  be  displayed  as  specified by the 1mactiveBackground 22mand
              1mactiveRelief 22moptions.  The only  element  values  understood  by
              this  command are 1marrow122m, 1mslider22m, or 1marrow222m.  If any other value
              is specified then no element of the scrollbar  will  be  active.
              If 4melement24m is not specified, the command returns the name of the
              element that is currently active, or an empty string if no  ele-
              ment is active.

       4mpathName24m 1mcget 4m22moption0m
              Returns  the  current value of the configuration option given by
              4moption24m.  4mOption24m may have any  of  the  values  accepted  by  the
              1mscrollbar 22mcommand.

       4mpathName24m 1mconfigure 22m?4moption24m? ?4mvalue24m 4moption24m 4mvalue24m 4m...24m?
              Query  or modify the configuration options of the widget.  If no
              4moption24m is specified, returns a list describing all of the avail-
              able  options for 4mpathName24m (see 1mTk_ConfigureInfo 22mfor information
              on the format of this list).  If 4moption24m  is  specified  with  no
              4mvalue24m,  then the command returns a list describing the one named
              option (this list will be identical to the corresponding sublist
              of  the  value  returned  if no 4moption24m is specified).  If one or
              more 4moption-value24m pairs are specified, then the command modifies
              the  given widget option(s) to have the given value(s);  in this
              case the command returns an empty string.  4mOption24m may  have  any
              of the values accepted by the 1mscrollbar 22mcommand.

       4mpathName24m 1mdelta 4m22mdeltaX24m 4mdeltaY0m
              Returns  a  real  number indicating the fractional change in the
              scrollbar setting that corresponds to a given change  in  slider
              position.   For  example,  if  the  scrollbar is horizontal, the
              result indicates how much the scrollbar setting must  change  to
              move the slider 4mdeltaX24m pixels to the right (4mdeltaY24m is ignored in
              this case).  If the scrollbar is vertical, the result  indicates
              how  much  the  scrollbar setting must change to move the slider
              4mdeltaY24m pixels down.  The arguments and the result may be zero or
              negative.

       4mpathName24m 1mfraction 4m22mx24m 4my0m
              Returns a real number between 0 and 1 indicating where the point
              given by 4mx24m and 4my24m lies in the trough area of the scrollbar.   The
              value  0 corresponds to the top or left of the trough, the value
              1 corresponds to the bottom or right,  0.5  corresponds  to  the
              middle,  and  so on.  4mX24m and 4my24m must be pixel coordinates relative
              to the scrollbar widget.  If 4mx24m and 4my24m refer to  a  point  outside
              the trough, the closest point in the trough is used.

       4mpathName24m 1mget0m
              Returns  the scrollbar settings in the form of a list whose ele-
              ments are the arguments to the most recent 1mset 22mwidget command.

       4mpathName24m 1midentify 4m22mx24m 4my0m
              Returns the name of the element under the point given by 4mx24m and 4my0m
              (such  as  1marrow122m), or an empty string if the point does not lie
              in any element of the scrollbar.  4mX24m and 4my24m must be pixel  coordi-
              nates relative to the scrollbar widget.

       4mpathName24m 1mset 4m22mfirst24m 4mlast0m
              This  command is invoked by the scrollbar's associated widget to
              tell the scrollbar about the current view in  the  widget.   The
              command  takes  two  arguments, each of which is a real fraction
              between 0 and 1.  The fractions describe the range of the  docu-
              ment  that is visible in the associated widget.  For example, if
              4mfirst24m is 0.2 and 4mlast24m is 0.4, it means that the  first  part  of
              the document visible in the window is 20% of the way through the
              document, and the last visible part is 40% of the way through.


1mSCROLLING COMMANDS0m
       When the user interacts with the scrollbar, for example by dragging the
       slider,  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 1m-command 22moption.  The com-
       mand may take any of the following forms.  In each case, 4mprefix24m is  the
       contents of the 1m-command 22moption, which usually has a form like 1m.t yview0m

       4mprefix24m 1mmoveto 4m22mfraction0m
              4mFraction24m is a real number between 0 and 1.   The  widget  should
              adjust  its  view so that the point given by 4mfraction24m appears at
              the beginning of the widget.  If 4mfraction24m is 0 it refers to  the
              beginning  of  the document.  1.0 refers to the end of the docu-
              ment, 0.333 refers to a point one-third of the way  through  the
              document, and so on.

       4mprefix24m 1mscroll 4m22mnumber24m 1munits0m
              The  widget  should  adjust its view by 4mnumber24m units.  The units
              are defined in whatever way makes sense for the widget, such  as
              characters or lines in a text widget.  4mNumber24m 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.

       4mprefix24m 1mscroll 4m22mnumber24m 1mpages0m
              The widget should adjust its view by 4mnumber24m 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.  4mNumber24m is either
              1, which means the next page should become visible, or -1, which
              means that the previous page should become visible.


1mOLD COMMAND SYNTAX0m
       In  versions  of  Tk before 4.0, the 1mset 22mand 1mget 22mwidget commands used a
       different form.  This form is still supported for backward  compatibil-
       ity,  but  it is deprecated.  In the old command syntax, the 1mset 22mwidget
       command has the following form:

       4mpathName24m 1mset 4m22mtotalUnits24m 4mwindowUnits24m 4mfirstUnit24m 4mlastUnit0m
              In this form the arguments are all integers.   4mTotalUnits24m  gives
              the  total  size of the object being displayed in the associated
              widget.  The meaning of one unit depends on the associated  wid-
              get;   for  example,  in a text editor widget units might corre-
              spond to lines of text.  4mWindowUnits24m indicates the total  number
              of  units  that  can  fit  in the associated window at one time.
              4mFirstUnit24m and 4mlastUnit24m give the indices of the  first  and  last
              units  currently  visible  in the associated window (zero corre-
              sponds to the first unit of the object).

       Under the old syntax the 1mget 22mwidget command  returns  a  list  of  four
       integers,  consisting  of  the  4mtotalUnits24m, 4mwindowUnits24m, 4mfirstUnit24m, and
       4mlastUnit24m values from the last 1mset 22mwidget command.

       The commands generated by scrollbars also have a  different  form  when
       the old syntax is being used:

       4mprefix24m 4munit0m
              4mUnit24m  is an integer that indicates what should appear at the top
              or left of the associated widget's  window.   It  has  the  same
              meaning  as the 4mfirstUnit24m and 4mlastUnit24m arguments to the 1mset 22mwid-
              get command.

       The most recent 1mset 22mwidget command determines whether or not to use the
       old syntax.  If it is given two real arguments then the new syntax will
       be used in the future, and if it is given four integer  arguments  then
       the old syntax will be used.


1mBINDINGS0m
       Tk  automatically  creates class bindings for scrollbars that give them
       the following default behavior.  If the behavior is different for  ver-
       tical  and  horizontal scrollbars, the horizontal behavior is described
       in parentheses.


       [1]    Pressing button 1 over 1marrow1 22mcauses the view in the  associated
              widget  to  shift  up  (left)  by  one unit so that the document
              appears to move down (right) one unit.  If the  button  is  held
              down, the action auto-repeats.

       [2]    Pressing button 1 over 1mtrough1 22mcauses the view in the associated
              widget to shift up (left) by one screenful so that the  document
              appears  to  move  down (right) one screenful.  If the button is
              held down, the action auto-repeats.

       [3]    Pressing button 1 over the slider and dragging causes  the  view
              to  drag  with the slider.  If the 1mjump 22moption is true, then the
              view doesn't drag along with the slider;  it changes  only  when
              the mouse button is released.

       [4]    Pressing button 1 over 1mtrough2 22mcauses the view in the associated
              widget to shift down (right) by one screenful so that the  docu-
              ment  appears to move up (left) one screenful.  If the button is
              held down, the action auto-repeats.

       [5]    Pressing button 1 over 1marrow2 22mcauses the view in the  associated
              widget  to  shift  down (right) by one unit so that the document
              appears to move up (left) one unit.  If the button is held down,
              the action auto-repeats.

       [6]    If  button  2  is pressed over the trough or the slider, it sets
              the view to correspond to  the  mouse  position;   dragging  the
              mouse with button 2 down causes the view to drag with the mouse.
              If button 2 is pressed over one of the  arrows,  it  causes  the
              same behavior as pressing button 1.

       [7]    If  button  1  is pressed with the Control key down, then if the
              mouse is over 1marrow1 22mor 1mtrough1 22mthe view changes to the very top
              (left)  of the document;  if the mouse is over 1marrow2 22mor 1mtrough20m
              the view changes to the very bottom (right) of the document;  if
              the  mouse is anywhere else then the button press has no effect.

       [8]    In vertical scrollbars the Up and Down keys have the same behav-
              ior  as  mouse  clicks over 1marrow1 22mand 1marrow222m, respectively.  In
              horizontal scrollbars these keys have no effect.

       [9]    In vertical scrollbars Control-Up and Control-Down have the same
              behavior as mouse clicks over 1mtrough1 22mand 1mtrough222m, respectively.
              In horizontal scrollbars these keys have no effect.

       [10]   In horizontal scrollbars the Up and  Down  keys  have  the  same
              behavior  as  mouse clicks over 1marrow1 22mand 1marrow222m, respectively.
              In vertical scrollbars these keys have no effect.

       [11]   In horizontal scrollbars Control-Up and  Control-Down  have  the
              same  behavior as mouse clicks over 1mtrough1 22mand 1mtrough222m, respec-
              tively.  In vertical scrollbars these keys have no effect.

       [12]   The Prior and Next keys have the same behavior as  mouse  clicks
              over 1mtrough1 22mand 1mtrough222m, respectively.

       [13]   The Home key adjusts the view to the top (left edge) of the doc-
              ument.

       [14]   The End key adjusts the view to the bottom (right edge)  of  the
              document.


1mKEYWORDS0m
