'\"macro stdmacro
.if n .pH g3x.curs_outopts @(#)curs_outopts	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/curs_outopts	1.3"
.nr X
.if \nX=0 .ds x} curs_outopts 3X "" "\&"
.if \nX=1 .ds x} curs_outopts 3X ""
.if \nX=2 .ds x} curs_outopts 3X "" "\&"
.if \nX=3 .ds x} curs_outopts "" "" "\&"
.TH \*(x}
.SH NAME
\f4curs_outopts\f2: \f4 clearok\f1, \f4idlok\f1, \f4idcok immedok\f1, \f4leaveok\f1, \f4setscrreg\f1, \f4wsetscrreg\f1, \f4scrollok\f1, \f4nl\f1, \f4nonl\f1 \- \f4curses\fP terminal output option control routines
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
int clearok(WINDOW *win, bool bf);
.sp .5
int idlok(WINDOW *win, bool bf);
.sp .5
void idcok(WINDOW *win, bool bf);
.sp .5
void immedok(WINDOW *win, bool bf);
.sp .5
int leaveok(WINDOW *win, bool bf);
.sp .5
int setscrreg(int top, int bot);
.sp 0.5
int wsetscrreg(WINDOW *win, int top, int bot);
.sp .5
int scrollok(WINDOW *win, bool bf);
.sp .5
int nl(void);
.sp 0.5
int nonl(void);
.ft 1
.fi
.SH DESCRIPTION
These routines set options that deal with output within \f4curses\fP.
All options are initially \f4FALSE\f1, unless otherwise stated.
It is not necessary to turn these options off before calling
\f4endwin\f1.
.PP
With the \f4clearok\f1 routine, if enabled (\f2bf\f1 is \f4TRUE\f1),
the next call to \f4wrefresh\f1 with this window will clear the screen
completely and redraw 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 \f2win\fP argument to \f4clearok\fP is the global variable
\f4curscr\fP, the next call to \f4wrefresh\fP with any window
causes the screen to be cleared and repainted from scratch.
.P
With the \f4idlok\f1 routine, if enabled (\f2bf\f1 is \f4TRUE\f1),
\f4curses\fP considers using the hardware insert/delete line
feature of terminals so equipped.
If disabled (\f2bf\f1 is \f4FALSE\f1),
\f4curses\fP very seldom uses this feature.
(The insert/delete character feature is always considered.)
This option should be enabled only if the application needs
insert/delete line, for example, for a screen editor.
It is disabled by default because insert/delete line tends to
be visually annoying when used in applications
where it isn't really needed.
If insert/delete line cannot be used, \f4curses\fP redraws
the changed portions of all lines.
.P
With the \f4idcok\f1 routine, if enabled (\f2bf\f1 is \f4TRUE\f1),
\f4curses\fP considers using the hardware insert/delete character feature
of terminals so equipped.
This is enabled by default.
.P
With the \f4immedok\f1 routine, if enabled (\f2bf\f1 is \f4TRUE)\f1,
any change in the window image, such as the ones caused by \f4waddch,
wclrtobot, wscrl\f1, \f2etc.\f1,
automatically cause a call to \f4wrefresh\f1.
However, it may degrade the performance considerably,
due to repeated calls to \f4wrefresh\f1.
It is disabled by default.
.P
Normally, the hardware cursor is left at the location of the window cursor
being refreshed.
The \f4leaveok\f1 option allows the cursor to be left wherever the update
happens to leave it.
It is useful for applications where the cursor is not used,
since it reduces the need for cursor motions.
If possible, the cursor is made invisible when this option is enabled.
.P
The \f4setscrreg\f1 and \f4wsetscrreg\f1
routines allow the application programmer to set a software scrolling
region in a window.
\f2top\f1 and \f2bot\f1 are the line numbers of the top
and bottom margin of the scrolling region.
(Line 0 is the top line of the window.)
If this option and \f4scrollok\f1
are 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 capability in the terminal,
like that in the VT100.
If \f4idlok\f1
is enabled and the terminal has either a scrolling region or insert/delete
line capability, they will probably be used by the output routines.)
.P
The \f4scrollok\f1 option controls what happens when
the cursor of a window 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 disabled,
(\f2bf\f1 is \f4FALSE\f1), the cursor is left on the bottom line.
If enabled, (\f2bf\f1 is \f4TRUE\f1),
\f4wrefresh\f1 is called 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,
it is also necessary to call \f4idlok\f1.]
.P
The \f4nl\f1 and \f4nonl\f1
routines control whether newline is translated into
carriage return and linefeed on output,
and whether return is translated into newline on input.
Initially,
the translations do occur.
By disabling these translations using \f4nonl\f1,
\f4curses\fP is able to make better use of the
linefeed capability, resulting in faster cursor motion.
.SH RETURN VALUE
\f4setscrreg\fP and \f4wsetscrreg\fP return \f4OK\fP upon
success and \f4ERR\fP upon failure.
All other routines that return an integer always return \f4OK\f1.
.SH NOTES
.P
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that
\f4clearok\fP,
\f4leaveok\fP,
\f4scrollok\fP,
\f4idcok\fP,
\f4nl\fP,
\f4nonl\fP
and \f4setscrreg\f1 may be macros.
.PP
The \f4immedok\f1 routine is useful
for windows that are used as terminal emulators.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_addch\fP(3X),
\f4curs_clear\fP(3X),
\f4curs_initscr\fP(3X),
\f4curs_scroll\fP(3X),
\f4curs_refresh\fP(3X).
.ad
