Specifications
Athena Widget Set libXaw 1.0.7
void ScrollProc(scrollbar, client_data, position)
Widget scrollbar;
XtPointer client_data;
XtPointer position;/*int */
scrollbar Specifies the Scrollbar widget.
client_data Specifies the client data.
position Specifies a pixel position in integer form.
The scrollProc callback is used for incremental scrolling and is called by the NotifyScroll action.
The position argument is a signed quantity and should be cast to an int when used. Using the
default button bindings, button 1 returns a positive value, and button 3 returns a negative value. In
both cases, the magnitude of the value is the distance of the pointer in pixels from the top (or left)
of the Scrollbar.The value will neverbegreater than the length of the Scrollbar.
The calling interface to the jumpProc callback procedure is:
void JumpProc(scrollbar, client_data, percent)
Widget scrollbar;
XtPointer client_data;
XtPointer percent_ptr;/*float* */
scrollbar Specifies the ID of the scroll bar widget.
client_data Specifies the client data.
percent_ptr Specifies the floating point position of the thumb (0.0 − 1.0).
The jumpProc callback is used to implement smooth scrolling and is called by the NotifyThumb
action. Percent_ptr must be cast to a pointer to float before use; i.e.
float percent = *(float*)percent_ptr;
With the default button bindings, button 2 movesthe thumb interactively,and the jumpProc is
called on each newposition of the pointer,while the pointer button remains down. The value
specified by percent_ptr is the current location of the thumb (from the top or left of the Scrollbar)
expressed as a percentage of the length of the Scrollbar.
3.7.4. Convenience Routines
To set the position and length of a Scrollbar thumb, use XawScrollbarSetThumb.
void XawScrollbarSetThumb(w, top, shown)
Widget w;
float top;
float shown;
w Specifies the Scrollbar widget.
top Specifies the position of the top of the thumb as a fraction of the length of the
Scrollbar.
shown Specifies the length of the thumb as a fraction of the total length of the Scrollbar.
XawScrollbarThumb movesthe visible thumb to a newposition (0.0 − 1.0) and length (0.0 −
1.0). Either the top or shown arguments can be specified as −1.0, in which case the current value
is left unchanged. Values greater than 1.0 are truncated to 1.0.
If called from jumpProc, XawScrollbarSetThumb has no effect.
45