clearok(3XC)
NAME
clearok, idlok, leaveok, scrollok, setscrreg, wsetscrreg − set terminal output controls
SYNOPSIS
#include <curses.h>
int clearok(WINDOW ∗win, bool bf);
int idlok (WINDOW ∗win, bool bf);
int leaveok (WINDOW ∗win, bool bf);
int scrollok (WINDOW ∗win, bool bf);
int setscrreg (int top, int bot);
int wssetscrreg (WINDOW ∗win, int top, int bot);
ARGUMENTS
winIs a pointer to a window.
bfIs a Boolean expression.
topIs the top line of the scrolling region (top of the window is line 0).
botIs the bottom line of the scrolling region (top of the window is line 0).
DESCRIPTION
These functions set options that deal with the output of X/Open Curses functions. The clearok() function checks the value of the Boolean expression bf. If bf is TRUE, clearok() clears and redraws the entire screen on the next call to refresh(3XC). If win is curscr, the next call to refresh() for any window clears and redraws the screen.
The idlok() function enables (bf is TRUE) or disables (bf is FALSE) the use of the insert/delete line capability of the terminal, provided that the terminal supports the operation. By default, the use of insert/delete line is disabled because its use is undesirable for most applications (screen editor applications are one exception). When disabled, X/Open Curses redraws the changed portions of all lines.
The leaveok() function controls the cursor positioning following a call to the refresh() function. If bf is TRUE, leaveok() leaves the cursor in a position that X/Open Curses finds convenient at the time that the window is refreshed. Normally, when a window is refreshed, leaveok() is disabled and the cursor is mapped from the logical window to the same location on the physical screen.
Enabling leavok() is useful when the cursor is not used or is not important in the application. Reducing cursor movements simplifies program interaction.
Once leaveok() is set to TRUE, it remains enabled until another call sets it to FALSE, or until the program terminates.
The scrollok() function controls what happens when the cursor advances outside the scrolling region. When enabled, if the cursor advances outside the scrolling region or a call to the scrl (3XC) function is made, the screen scolls up one line.
The terminal screen will produce a scrolling effect if idlok() is also enabled.
The setscreg() and wsetscrreg() functions set up scrolling regions in the windows stdscr and win, respectively. The dimensions of the scrolling region are defined by the top and bottom parameter. If scrollok() is enabled and the cursor is on the last line of the scroll region, any attempt to move the cursor beyond the bottom margin of the scrolling region scrolls the scrolling region up by one line. By default, the scrolling region of a window is the entire window.
For full screen windows, the terminal screen produces a scrolling effect if idlok() is also enabled.
RETURN VALUES
On success, the setscrreg() and wsetscrreg() functions return OK. Otherwise, they return ERR.
The other functions always return OK.
ERRORS
None.
SEE ALSO
bkgdset(3XC), clear(3XC), doupdate(3XC), scrl(3XC)
SunOS 5.6 — Last change: 1 Jun 1996