1 .\"***************************************************************************
2 .\" Copyright 2018-2021,2022 Thomas E. Dickey *
3 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a *
6 .\" copy of this software and associated documentation files (the *
7 .\" "Software"), to deal in the Software without restriction, including *
8 .\" without limitation the rights to use, copy, modify, merge, publish, *
9 .\" distribute, distribute with modifications, sublicense, and/or sell *
10 .\" copies of the Software, and to permit persons to whom the Software is *
11 .\" furnished to do so, subject to the following conditions: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 .\" Except as contained in this notice, the name(s) of the above copyright *
25 .\" holders shall not be used in advertising or otherwise to promote the *
26 .\" sale, use or other dealings in this Software without prior written *
28 .\"***************************************************************************
30 .\" $Id: curs_outopts.3x,v 1.36 2022/02/12 20:05:11 tom Exp $
31 .TH curs_outopts 3X ""
46 \fBscrollok\fP \- \fBcurses\fP output options
50 \fB#include <curses.h>\fP
52 \fBint clearok(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
54 \fBint idlok(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
56 \fBvoid idcok(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
58 \fBvoid immedok(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
60 \fBint leaveok(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
62 \fBint scrollok(WINDOW *\fIwin\fB, bool \fIbf\fB);\fR
64 \fBint setscrreg(int \fItop\fB, int \fIbot\fB);\fR
66 \fBint wsetscrreg(WINDOW *\fIwin\fB, int \fItop\fB, int \fIbot\fB);\fR
70 These routines set options that change the style of output within
72 All options are initially \fBFALSE\fP, unless otherwise stated.
73 It is not necessary to turn these options off before calling \fBendwin\fP(3X).
76 If \fBclearok\fP is called with \fBTRUE\fP as argument, the next
77 call to \fBwrefresh\fP with this window will clear the screen completely and
78 redraw the entire screen from scratch.
79 This is useful when the contents of the
80 screen are uncertain, or in some cases for a more pleasing visual effect.
82 the \fIwin\fP argument to \fBclearok\fP is the global variable \fBcurscr\fP,
83 the next call to \fBwrefresh\fP with any window causes the screen to be cleared
84 and repainted from scratch.
87 If \fBidlok\fP is called with \fBTRUE\fP as second argument, \fBcurses\fP
88 considers using the hardware insert/delete line feature of terminals so
90 Calling \fBidlok\fP with \fBFALSE\fP as second argument disables use
91 of line insertion and deletion.
92 This option should be enabled only if the
93 application needs insert/delete line, for example, for a screen editor.
95 disabled by default because insert/delete line tends to be visually annoying
96 when used in applications where it is not really needed.
98 cannot be used, \fBcurses\fP redraws the changed portions of all lines.
101 If \fBidcok\fP is called with \fBFALSE\fP as second argument, \fBcurses\fP
102 no longer considers using the hardware insert/delete character feature of
103 terminals so equipped.
104 Use of character insert/delete is enabled by default.
105 Calling \fBidcok\fP with \fBTRUE\fP as second argument re-enables use
106 of character insertion and deletion.
109 If \fBimmedok\fP is called with \fBTRUE as argument\fP, any change
110 in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fP,
111 etc., automatically cause a call to \fBwrefresh\fP.
113 degrade performance considerably, due to repeated calls to \fBwrefresh\fP.
114 It is disabled by default.
117 Normally, the hardware cursor is left at the location of the window cursor
119 The \fBleaveok\fP option allows the cursor to be left
120 wherever the update happens to leave it.
121 It is useful for applications where
122 the cursor is not used, since it reduces the need for cursor motions.
125 The \fBscrollok\fP option controls what happens when the cursor of a window is
126 moved off the edge of the window or scrolling region, either as a result of a
127 newline action on the bottom line, or typing the last character of the last
129 If disabled, (\fIbf\fP is \fBFALSE\fP), the cursor is left on the bottom
131 If enabled, (\fIbf\fP is \fBTRUE\fP), the window is scrolled up one line
132 (Note that to get the physical scrolling effect on the terminal, it is
133 also necessary to call \fBidlok\fP).
134 .SS setscrreg/wsetscrreg
136 The \fBsetscrreg\fP and \fBwsetscrreg\fP routines allow the application
137 programmer to set a software scrolling region in a window.
140 are the line numbers of the top and bottom margin of the scrolling
142 (Line 0 is the top line of the window.) If this option and
143 \fBscrollok\fP are enabled, an attempt to move off the bottom margin line
144 causes all lines in the scrolling region to scroll one line in the direction
146 Only the text of the window is scrolled.
148 has nothing to do with the use of a physical scrolling region capability in the
149 terminal, like that in the VT100.
150 If \fBidlok\fP is enabled and the terminal
151 has either a scrolling region or insert/delete line capability, they will
152 probably be used by the output routines.)
154 The functions \fBsetscrreg\fP and \fBwsetscrreg\fP return \fBOK\fP upon success
155 and \fBERR\fP upon failure.
156 All other routines that return an integer always
159 X/Open Curses does not define any error conditions.
161 In this implementation,
163 those functions that have a window pointer
164 will return an error if the window pointer is null
167 returns an error if the scrolling region limits extend outside the window.
170 X/Open does not define any error conditions.
171 This implementation returns an error
172 if the window pointer is null.
174 These functions are described in the XSI Curses standard, Issue 4.
176 From the outset, ncurses used \fBnl\fP/\fBnonl\fP to control the conversion
177 of newlines to carriage return/line-feed on output as well as input.
178 XSI Curses documents only the use of these functions for input.
179 This difference arose from converting the \fIpcurses\fP source
180 (which used \fBioctl\fP calls with the \fBsgttyb\fP structure)
181 to termios (i.e., the POSIX terminal interface).
182 In the former, both input and output were controlled via a single
184 while the latter separates these features.
185 Because that conversion interferes with output optimization,
186 \fBnl\fP/\fBnonl\fP were amended after ncurses 6.2
187 to eliminate their effect on output.
189 Some historic curses implementations had, as an undocumented feature, the
190 ability to do the equivalent of \fBclearok(..., 1)\fP by saying
191 \fBtouchwin(stdscr)\fP or \fBclear(stdscr)\fP.
192 This will not work under ncurses.
194 Earlier System V curses implementations specified that with \fBscrollok\fP
195 enabled, any window modification triggering a scroll also forced a physical
197 XSI Curses does not require this, and \fBncurses\fP avoids doing
198 it to perform better vertical-motion optimization at \fBwrefresh\fP
201 The XSI Curses standard does not mention that the cursor should be
202 made invisible as a side-effect of \fBleaveok\fP.
203 SVr4 curses documentation does this, but the code does not.
204 Use \fBcurs_set\fP to make the cursor invisible.
211 \fBsetscrreg\fP may be macros.
213 The \fBimmedok\fP routine is useful for windows that are used as terminal
218 \fBcurs_addch\fP(3X),
219 \fBcurs_clear\fP(3X),
220 \fBcurs_initscr\fP(3X),
221 \fBcurs_scroll\fP(3X),
222 \fBcurs_refresh\fP(3X),
223 \fBcurs_variables\fP(3X).