]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_outopts.3x
ncurses 5.3
[ncurses.git] / man / curs_outopts.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998,2001 Free Software Foundation, Inc.                   *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_outopts.3x,v 1.17 2001/10/14 00:50:30 tom Exp $
30 .TH curs_outopts 3X ""
31 .SH NAME
32 \fBclearok\fR, \fBidlok\fR, \fBidcok\fR, \fBimmedok\fR,
33 \fBleaveok\fR, \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBscrollok\fR,
34 \fBnl\fR, \fBnonl\fR - \fBcurses\fR output options
35 .SH SYNOPSIS
36 \fB#include <curses.h>\fR
37
38 \fBint clearok(WINDOW *win, bool bf);\fR
39 .br
40 \fBint idlok(WINDOW *win, bool bf);\fR
41 .br
42 \fBvoid idcok(WINDOW *win, bool bf);\fR
43 .br
44 \fBvoid immedok(WINDOW *win, bool bf);\fR
45 .br
46 \fBint leaveok(WINDOW *win, bool bf);\fR
47 .br
48 \fBint setscrreg(int top, int bot);\fR
49 .br
50 \fBint wsetscrreg(WINDOW *win, int top, int bot);\fR
51 .br
52 \fBint scrollok(WINDOW *win, bool bf);\fR
53 .br
54 \fBint nl(void);\fR
55 .br
56 \fBint nonl(void);\fR
57 .br
58 .SH DESCRIPTION
59 These routines set options that change the style of output within
60 \fBcurses\fR.
61 All options are initially \fBFALSE\fR, unless otherwise stated.
62 It is not necessary to turn these options off before calling \fBendwin\fR.
63
64 If \fBclearok\fR is called with \fBTRUE\fR as argument, the next
65 call to \fBwrefresh\fR with this window will clear the screen completely and
66 redraw the entire screen from scratch.
67 This is useful when the contents of the
68 screen are uncertain, or in some cases for a more pleasing visual effect.
69 If
70 the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR,
71 the next call to \fBwrefresh\fR with any window causes the screen to be cleared
72 and repainted from scratch.
73
74 If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR
75 considers using the hardware insert/delete line feature of terminals so
76 equipped.
77 Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use
78 of line insertion and deletion.
79 This option should be enabled only if the
80 application needs insert/delete line, for example, for a screen editor.
81 It is
82 disabled by default because insert/delete line tends to be visually annoying
83 when used in applications where it isn't really needed.
84 If insert/delete line
85 cannot be used, \fBcurses\fR redraws the changed portions of all lines.
86
87 If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR
88 no longer considers using the hardware insert/delete character feature of
89 terminals so equipped.
90 Use of character insert/delete is enabled by default.
91 Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use
92 of character insertion and deletion.
93
94 If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change
95 in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR,
96 \fIetc\fR., automatically cause a call to \fBwrefresh\fR.
97 However, it may
98 degrade performance considerably, due to repeated calls to \fBwrefresh\fR.
99 It is disabled by default.
100
101 Normally, the hardware cursor is left at the location of the window cursor
102 being refreshed.
103 The \fBleaveok\fR option allows the cursor to be left
104 wherever the update happens to leave it.
105 It is useful for applications where
106 the cursor is not used, since it reduces the need for cursor motions.
107
108 The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application
109 programmer to set a software scrolling region in a window.
110 \fItop\fR and
111 \fIbot\fR are the line numbers of the top and bottom margin of the scrolling
112 region.
113 (Line 0 is the top line of the window.)  If this option and
114 \fBscrollok\fR are enabled, an attempt to move off the bottom margin line
115 causes all lines in the scrolling region to scroll one line in the direction
116 of the first line.
117 Only the text of the window is scrolled.
118 (Note that this
119 has nothing to do with the use of a physical scrolling region capability in the
120 terminal, like that in the VT100.
121 If \fBidlok\fR is enabled and the terminal
122 has either a scrolling region or insert/delete line capability, they will
123 probably be used by the output routines.)
124
125 The \fBscrollok\fR 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
128 line.
129 If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom
130 line.
131 If enabled, (\fIbf\fR is \fBTRUE\fR), 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\fR).
134
135 The \fBnl\fR and \fBnonl\fR routines control whether the underlying display
136 device translates the return key into newline on input, and whether it
137 translates newline into return and line-feed on output (in either case, the
138 call \fBaddch('\\n')\fR does the equivalent of return and line feed on the
139 virtual screen).
140 Initially, these translations do occur.
141 If you disable them
142 using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed
143 capability, resulting in faster cursor motion.
144 Also, \fBcurses\fR will then be
145 able to detect the return key.
146 .SH RETURN VALUE
147 The functions \fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success
148 and \fBERR\fR upon failure.
149 All other routines that return an integer always
150 return \fBOK\fR.
151 .SH PORTABILITY
152 These functions are described in the XSI Curses standard, Issue 4.
153
154 The XSI Curses standard is ambiguous on the question of whether \fBraw\fR()
155 should disable the CRLF translations controlled by \fBnl\fR() and \fBnonl\fR().
156 BSD curses did turn off these translations; AT&T curses (at least as late as
157 SVr1) did not.
158 We choose to do so, on the theory that a programmer requesting
159 raw input wants a clean (ideally 8-bit clean) connection that the operating
160 system does not mess with.
161
162 Some historic curses implementations had, as an undocumented feature, the
163 ability to do the equivalent of \fBclearok(..., 1)\fR by saying
164 \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR.
165 This will not work under
166 ncurses.
167
168 Earlier System V curses implementations specified that with \fBscrollok\fR 
169 enabled, any window modification triggering a scroll also forced a physical
170 refresh.
171 XSI Curses does not require this, and \fBncurses\fR avoids doing
172 it to perform better vertical-motion optimization at \fBwrefresh\fR
173 time.
174
175 The XSI Curses standard does not mention that the cursor should be
176 made invisible as a side-effect of \fBleaveok\fR.
177 SVr4 curses documentation does this, but the code does not.
178 Use \fBcurs_set\fR to make the cursor invisible.
179 .SH NOTES
180 Note that \fBclearok\fR, \fBleaveok\fR, \fBscrollok\fR, \fBidcok\fR, \fBnl\fR,
181 \fBnonl\fR and \fBsetscrreg\fR may be macros.
182
183 The \fBimmedok\fR routine is useful for windows that are used as terminal
184 emulators.
185 .SH SEE ALSO
186 \fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_clear\fR(3X),
187 \fBcurs_initscr\fR(3X), \fBcurs_scroll\fR(3X), \fBcurs_refresh\fR(3X)
188 .\"#
189 .\"# The following sets edit modes for GNU EMACS
190 .\"# Local Variables:
191 .\"# mode:nroff
192 .\"# fill-column:79
193 .\"# End: