Setting the Maximum Number of Rows to Scroll

When you write to a window, the information goes into the window's memory screen buffer. You can control what happens if you write past the end of the buffer by adjusting the maximum scrolling quantity of the window. Information that is scrolled out of the window buffer is lost.

The default is for scrolling to occur until string output is completely written. Output continues because the maximum number of rows to scroll is unlimited when the scrolling quantity is set to the defined value AS_NEEDED. In some cases, this may cause the beginning of the string output to scroll off the top of the window buffer. You can change the maximum number of rows to scroll to prevent this from happening.

To set the maximum number of rows to scroll, use the set scrolling quantity function, sw_scrlq():

void sw_scrlq(scrlq, wnp)
 
int scrlq;
/* Maximum number of rows to scroll up
*/
WINDOWPTR wnp;
/* Pointer to a window structure
*/

Use the #defined value AS_NEEDED for scrlq to allow the window to scroll as much as necessary to contain the information written to it. AS_NEEDED allows unlimited scrolling.

If you set the scrolling quantity to two, one row will be scrolled up in an attempt to write the rest of the string. If the string is still not completely written, another row is scrolled. However, if the string does not fit on this row, output will stop.

If you do not want output to scroll at all, set the scrolling quantity to 0.


Home Contents Previous Next