DESIGN (kwidgets) functions


LIBRARY ROUTINE

xvw_create_scrollbar - create scrollbar GUI object

LIBRARY CALL

xvobject xvw_create_scrollbar(
   xvobject parent,
   char   *name)

INPUT

OUTPUT

none

RETURN VALUE

The Scrollbar object on success, NULL on failure.

DESCRIPTION

The scrollbar GUI object allows users to reposition data that is too large to fit in a viewing window. Typically, the scrollbar is used by other objects that serve as a backplane for a large number of subordinate objects that will not fit within the viewing area. For example, the TextDisplay object has a built-in scrollbar which allows the user to scroll through the text being displayed, and the List object will display a scrollbar if the number of items in the list exceeds the space provided by the height of the List object. The Viewport object also has built-in scrollbars to allow the user to shift the area of view, as does the Canvas object.

The Scrollbar consists of a long, thin area called the scrollbar trough, within which is a smaller, movable button called the slider. Scrollbars may be horizontal or vertical. Horizontal scrollbars have the minimum value at the top and the maximum value at the bottom; vertical scrollbars have the minimum value at the left and the maximum value at the right.

With a horizontal scrollbar, clicking in the scrollbar trough to the right of the slider will cause the scrollbar to increment in value; clicking in the scrollbar trough to the left of the slider will cause the scrollbar to decrement in value. Similarly with a vertical scrollbar, clicking above the slider will decrement the value while clicking below the slider will increment the value. The slider itself can be dragged back and forth (with a horizontal scrollbar) or up and down (with a vertical scrollbar) to change the value.

A callback can be installed on the scrollbar for incremental movement; this callbeack will be fired when the user clicks in the scrollbar trough (after the scrollbar value is incremented or decremented). The same callback or another callback may be installed on the scrollbar for continuous movement; this callback will be fired when the user moves the slider of the scrollbar (after the scrollbar value is updated).

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DESIGN/objects/library/kwidgets/src/Scrollbar.c

SEE ALSO

kwidgets(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.