Adding Manually Updated Scroll Bars to a Window

Scroll bars can be maintained automatically or manually.

Code: To add a manual-update scroll bar, call:

sw_sb(MANUALUPD, sb_type, wnp);

After adding a manual-update scroll bar, set the range to use for the scroll bar(s) you added by calling:

sw_sbrange(min, max, sb_type, wnp)

int min;

int max;

ULONG sb_type;

WINDOWPTR wnp;

where min and max are the minimum and maximum values for the range. The scroll bar type can be HSBAR or VSBAR.

To use the manually updated scroll bar, simply tell the system whenever the scroll bar's current value changes by calling:

sw_sbval(newval, sb_type, wnp)

int newval;

ULONG sb_type;

WINDOWPTR wnp;

The scroll bar type can be HSBAR or VSBAR. If these functions are called when the window is set on the screen, the system automatically handles translating the current value into a thumb position and updating it on the screen.


Home Contents Previous Next