curs_outopts, clearok, idcok, idlok, immedok, leaveok, nl, nonl, setscrreg, wsetscrreg, scrollok - Routines for controlling output options for a Curses terminal
Curses Library (libcurses)
Interfaces documented on this reference page conform to industry standards as follows:
clearok, idlok, leaveok, nl, nonl, setscrreg, wsetscrreg: XPG4, XPG4-UNIX
idcok, immedok: XPG4-UNIX
Refer to the
reference page for more information
about industry standards and associated tags.
These routines set options that deal with output within Curses. Unless stated otherwise, all options are initially FALSE. It is not necessary to turn these options off before calling endwin.
The clearok routine enables and disables the clearok option. If this option is enabled (bf is set to TRUE), the next call to wrefresh with this window clears the screen completely and redraws the entire screen from scratch. This is useful when the contents of the screen are uncertain or, in some cases, for a more pleasing visual effect. If the win argument to clearok is the global variable curscr, the next call to wrefresh with any window causes the screen to be cleared and repainted from scratch.
The idlok routine enables and disables the idlok option. If this option is enabled (bf is set to TRUE), Curses considers using the hardware insert/delete line feature if the terminal is so equipped. If the idlok is disabled (bf is set to FALSE), Curses very seldom uses this hardware feature. (The insert/delete character feature is always considered.) This option should be enabled only if the application needs the insert/delete line feature, for example, for a screen editor. The option is disabled by default because insert/delete line tends to be visually annoying when used in applications where it is not needed. If the insert/delete line feature cannot be used, Curses redraws the changed portions of all lines.
The idcok routine enables and disables the idcok option. If this option is enabled (bf is set to TRUE), Curses considers using the hardware insert/delete character feature if the terminal is so equipped. The idcok option is enabled by default.
The immedok routine enables and disables the immedok option. If this option is enabled (bf is set to TRUE), any change in the window image, such as the ones caused by waddch, wclrtobot, wscrl, and similar routines, automatically causes a call to wrefresh. Enabling the immedok option may degrade performance considerably due to repeated calls to wrefresh. The option is disabled by default.
The leaveok routine enables and disables the leaveok option. Usually, the hardware cursor is left at the location of the cursor in the window being refreshed. When the leaveok option is enabled, the cursor is left wherever the update happens to leave it. Because this option reduces the need for cursor motions, it is useful for applications that do not use the cursor. If possible, Curses makes the cursor invisible when leaveok is enabled.
The setscrreg and wsetscrreg routines set a software scrolling region in a window. The top and bot parameters are the line numbers of the top and bottom margin of the scrolling region. (Line 0 is the top line of the window.) If a scrolling region is set and scrollok is enabled, an attempt to move off the bottom margin line causes all lines in the scrolling region to scroll up one line. Only the text of the window is scrolled. (Note that this has nothing to do with the use of a physical scrolling region in a terminal, such as the VT100. If the idlok option is enabled and the terminal has either a scrolling region or an insert/delete line capability, then the output routines will probably use one of these.)
The scrollok routine enables and disables the scrollok option. This option controls what happens when the window cursor is moved off the edge of the window or scrolling region, either as a result of a newline action on the bottom line or typing the last character of the last line. If the scrollok option is disabled, (bf is set to FALSE), the cursor is left on the bottom line. If the option is enabled, (bf is set to TRUE), Curses calls wrefresh on the window, and the physical terminal and window are scrolled up one line. (Note that in order to get the physical scrolling effect on the terminal, applications must also call idlok.)
whether the newline character is translated into carriage return and linefeed
on output, and whether carriage return is translated into newline on input.
By default, the translations do occur. When the application disables these
translations by using
able to make better use of the linefeed capability, resulting in faster cursor
The header file <curses.h> automatically includes the header file <stdio.h>.
Note that nl, nonl and setscrreg may be macros.
routine is useful for windows that are
created as terminal emulators.
upon success and
All other routines that return an integer always return
Functions: curses(3), curs_addch(3), curs_clear(3), curs_initscr(3), curs_refresh(3), curs_scroll(3)