Terminal output control subroutines.
Curses Library (libcurses.a)
#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 wsetscrreg(WINDOW *win, int top, int bot);
These subroutines set options that deal with output within Curses.
The clearok subroutine assigns the value of bf to an internal flag in the specified window that governs clearing of the screen during a refresh. If, during a refresh operation on the specified window, the flag in curscr is TRUE or the flag in the specified window is TRUE, then the implementation clears the screen, redraws it in its entirety, and sets the flag to FALSE in curscr and in the specified window. The initial state is unspecified.
The idlok subroutine specifies whether the implementation may use the hardware insert-line, delete-line, and scroll features of terminals so equIpped. If bf is TRUE, use of these features is enabled. If bf is FALSE, use of these features is disabled and lines are instead redrawn as required. The initial state is FALSE.
The leaveok subroutine controls the cursor position after a refresh operation. If bf is TRUE, refresh operations on the specified window may leave the terminal's cursor at an arbitrary position. If bf is FALSE, then at the end of any refresh operation, the terminal's cursor is positioned at the cursor position contained in the specified window. The initial state is FALSE.
The scrollok subroutine controls the use of scrolling. If bf is TRUE, then scrolling is enabled for the specified window, with the consequences discussed in Truncation, Wrapping and Scrolling on page 28. If bf is FALSE, scrolling is disabled for the specified window. The initial state is FALSE.
The setscrreg and wsetscrreg subroutines define a software scrolling region in the current or specified window. The top and bot arguments are the line numbers of the first and last line defining the scrolling region. (Line 0 is the top line of the window.) If this option and the scrollok subroutine are enabled, an attempt to move off the last line of the margin causes all lines in the scrolling region to scroll one line in the direction of the first line. Only characters in the window are scrolled. If a software scrolling region is set and the scrollok subroutine is not enabled, an attempt to move off the last line of the margin does not reposition any lines in the scrolling region.
The parameters for the clearok subroutine are:
The parameters for the idlok subroutine are:
Flag | Specifies whether to enable curses to use the hardware insert/delete line feature (TRUE) or not (FALSE). |
Window | Specifies the window it will affect. |
The parameters for the leaveok subroutine are:
The parameters for the scrollok subroutine are:
Flag | Enables scrolling when set to TRUE. Otherwise, set the Flag parameter to FALSE to disable scrolling. |
Window | Identifies the window in which to enable or disable scrolling. |
The parameters for the setscrreg and wsetscrreg subroutines are:
Upon successful completion, the setscrreg and wsetscrreg subroutines return OK. Otherwise, they return ERR.
The other subroutines always return OK.
Examples for the clearok subroutine are:
WINDOW *my_screen; clearok(my_screen, TRUE);
clearok(stdscr, TRUE);
Examples for the idlok subroutine are:
idlok(stdscr, TRUE);
idlok(my_window, FALSE);
Examples for the leaveok subroutine are:
WINDOW *my_window; leaveok(my_window, FALSE);
WINDOW *my_window; leaveok(my_window, TRUE);
Examples for the scrollok subroutine are:
WINDOW *my_window; scrollok(my_window, TRUE);
WINDOW *my_window; scrollok(my_window, FALSE);
Examples for the setscrreg or wsetscrreg subroutine are:
setscrreg(9, 29);
WINDOW *my_window; wsetscrreg(my_window, 9, 29);
The doupdate (doupdate, refresh, wnoutrefresh, or wrefresh Subroutines) subroutine, scrl (scrl, scroll, wscrl Subroutine) subroutine, refresh or wrefresh (refresh or wrefresh Subroutine) subroutine.
Curses Library, List of Additional Curses Subroutines, and Manipulating Characters with Curses in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.