Scrollbar
A scrollbar is a widget that displays two arrows, one at each end of the scrollbar, and a
slider in the middle portion of the scrollbar. A scrollbar is used to provide
information about what is visible in an associated window that displays an
object of some sort (such as a file being edited or a drawing).
The position and size of the slider indicate which portion of the object 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 object.
Scrollbars can be used to adjust the view in the associated window by clicking or dragging
with the mouse.
Control
The description below assumes a vertically-oriented scrollbar. For a
horizontally-oriented scrollbar replace the words ``up'', ``down'', ``top'', and
``bottom'' with ``left'', ``right'', ``left'', and ``right'', respectively.
A scrollbar widget is divided into five distinct areas. From top to bottom, they are: the
top arrow, the top gap (the empty space between the arrow and the slider), the slider, the
bottom gap, and the bottom arrow. Pressing mouse button 1 in each area has a different
effect:
- top arrow
- Causes the view in the associated window to shift up by one unit (i.e. the object appears to move down one unit in its window). If the button is held down the action will auto-repeat.
- top gap
- Causes the view in the associated window to shift up by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very top of the window will now appear at the very bottom). If the button is held down the action will auto-repeat.
- slider
- Pressing button 1 in this area has no immediate effect except to cause the slider to appear sunken rather than raised. However, if the mouse is moved with the button down then the slider will be dragged, adjusting the view as the mouse is moved.
- bottom gap
- Causes the view in the associated window to shift down by one less than the number of units in the window (i.e. the portion of the object that used to appear at the very bottom of the window will now appear at the very top). If the button is held down the action will auto-repeat.
- bottom arrow
- Causes the view in the associated window to shift down by one unit (i.e. the object appears to move up one unit in its window). If the button is held down the action will auto-repeat.