1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
3 ****************************************************************************
4 * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
6 * Permission is hereby granted, free of charge, to any person obtaining a *
7 * copy of this software and associated documentation files (the *
8 * "Software"), to deal in the Software without restriction, including *
9 * without limitation the rights to use, copy, modify, merge, publish, *
10 * distribute, distribute with modifications, sublicense, and/or sell *
11 * copies of the Software, and to permit persons to whom the Software is *
12 * furnished to do so, subject to the following conditions: *
14 * The above copyright notice and this permission notice shall be included *
15 * in all copies or substantial portions of the Software. *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
25 * Except as contained in this notice, the name(s) of the above copyright *
26 * holders shall not be used in advertising or otherwise to promote the *
27 * sale, use or other dealings in this Software without prior written *
29 ****************************************************************************
30 * @Id: curs_outopts.3x,v 1.25 2010/12/04 18:38:55 tom Exp @
34 <TITLE>curs_outopts 3x</TITLE>
35 <link rev=made href="mailto:bug-ncurses@gnu.org">
36 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 <H1>curs_outopts 3x</H1>
42 <!-- Manpage converted by man2html 3.0.1 -->
43 <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG> <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
50 <STRONG>clearok</STRONG>, <STRONG>idlok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>immedok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>setscrreg</STRONG>,
51 <STRONG>wsetscrreg</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> - <STRONG>curses</STRONG> output options
55 <H2>SYNOPSIS</H2><PRE>
56 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
58 <STRONG>int</STRONG> <STRONG>clearok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
59 <STRONG>int</STRONG> <STRONG>idlok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
60 <STRONG>void</STRONG> <STRONG>idcok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
61 <STRONG>void</STRONG> <STRONG>immedok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
62 <STRONG>int</STRONG> <STRONG>leaveok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
63 <STRONG>int</STRONG> <STRONG>setscrreg(int</STRONG> <STRONG>top,</STRONG> <STRONG>int</STRONG> <STRONG>bot);</STRONG>
64 <STRONG>int</STRONG> <STRONG>wsetscrreg(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>top,</STRONG> <STRONG>int</STRONG> <STRONG>bot);</STRONG>
65 <STRONG>int</STRONG> <STRONG>scrollok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
66 <STRONG>int</STRONG> <STRONG>nl(void);</STRONG>
67 <STRONG>int</STRONG> <STRONG>nonl(void);</STRONG>
71 <H2>DESCRIPTION</H2><PRE>
72 These routines set options that change the style of output
73 within <STRONG>curses</STRONG>. All options are initially <STRONG>FALSE</STRONG>, unless
74 otherwise stated. It is not necessary to turn these op-
75 tions off before calling <STRONG>endwin</STRONG>.
77 If <STRONG>clearok</STRONG> is called with <STRONG>TRUE</STRONG> as argument, the next call
78 to <STRONG>wrefresh</STRONG> with this window will clear the screen com-
79 pletely and redraw the entire screen from scratch. This
80 is useful when the contents of the screen are uncertain,
81 or in some cases for a more pleasing visual effect. If
82 the <EM>win</EM> argument to <STRONG>clearok</STRONG> is the global variable <STRONG>curscr</STRONG>,
83 the next call to <STRONG>wrefresh</STRONG> with any window causes the
84 screen to be cleared and repainted from scratch.
86 If <STRONG>idlok</STRONG> is called with <STRONG>TRUE</STRONG> as second argument, <STRONG>curses</STRONG>
87 considers using the hardware insert/delete line feature of
88 terminals so equipped. Calling <STRONG>idlok</STRONG> with <STRONG>FALSE</STRONG> as second
89 argument disables use of line insertion and deletion.
90 This option should be enabled only if the application
91 needs insert/delete line, for example, for a screen edi-
92 tor. It is disabled by default because insert/delete line
93 tends to be visually annoying when used in applications
94 where it is not really needed. If insert/delete line can-
95 not be used, <STRONG>curses</STRONG> redraws the changed portions of all
98 If <STRONG>idcok</STRONG> is called with <STRONG>FALSE</STRONG> as second argument, <STRONG>curses</STRONG>
99 no longer considers using the hardware insert/delete char-
100 acter feature of terminals so equipped. Use of character
101 insert/delete is enabled by default. Calling <STRONG>idcok</STRONG> with
102 <STRONG>TRUE</STRONG> as second argument re-enables use of character inser-
105 If <STRONG>immedok</STRONG> is called with <STRONG>TRUE</STRONG> <STRONG>as</STRONG> <STRONG>argument</STRONG>, any change in
106 the window image, such as the ones caused by <STRONG>waddch,</STRONG> <STRONG>wclr-</STRONG>
107 <STRONG>tobot,</STRONG> <STRONG>wscrl</STRONG>, etc., automatically cause a call to <STRONG>wre-</STRONG>
108 <STRONG>fresh</STRONG>. However, it may degrade performance considerably,
109 due to repeated calls to <STRONG>wrefresh</STRONG>. It is disabled by de-
112 Normally, the hardware cursor is left at the location of
113 the window cursor being refreshed. The <STRONG>leaveok</STRONG> option al-
114 lows the cursor to be left wherever the update happens to
115 leave it. It is useful for applications where the cursor
116 is not used, since it reduces the need for cursor motions.
118 The <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> routines allow the applica-
119 tion programmer to set a software scrolling region in a
120 window. The <EM>top</EM> and <EM>bot</EM> parameters are the line numbers
121 of the top and bottom margin of the scrolling region.
122 (Line 0 is the top line of the window.) If this option
123 and <STRONG>scrollok</STRONG> are enabled, an attempt to move off the bot-
124 tom margin line causes all lines in the scrolling region
125 to scroll one line in the direction of the first line.
126 Only the text of the window is scrolled. (Note that this
127 has nothing to do with the use of a physical scrolling re-
128 gion capability in the terminal, like that in the VT100.
129 If <STRONG>idlok</STRONG> is enabled and the terminal has either a
130 scrolling region or insert/delete line capability, they
131 will probably be used by the output routines.)
133 The <STRONG>scrollok</STRONG> option controls what happens when the cursor
134 of a window is moved off the edge of the window or
135 scrolling region, either as a result of a newline action
136 on the bottom line, or typing the last character of the
137 last line. If disabled, (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the cursor is left
138 on the bottom line. If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the window
139 is scrolled up one line (Note that to get the physical
140 scrolling effect on the terminal, it is also necessary to
141 call <STRONG>idlok</STRONG>).
143 The <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> routines control whether the underlying
144 display device translates the return key into newline on
145 input, and whether it translates newline into return and
146 line-feed on output (in either case, the call <STRONG>addch('\n')</STRONG>
147 does the equivalent of return and line feed on the virtual
148 screen). Initially, these translations do occur. If you
149 disable them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make bet-
150 ter use of the line-feed capability, resulting in faster
151 cursor motion. Also, <STRONG>curses</STRONG> will then be able to detect
156 <H2>RETURN VALUE</H2><PRE>
157 The functions <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> return <STRONG>OK</STRONG> upon suc-
158 cess and <STRONG>ERR</STRONG> upon failure. All other routines that return
159 an integer always return <STRONG>OK</STRONG>.
161 X/Open does not define any error conditions.
163 In this implementation, those functions that have a window
164 pointer will return an error if the window pointer is
167 <STRONG>wclrtoeol</STRONG>
168 returns an error if the cursor position is
171 <STRONG>wsetscrreg</STRONG>
172 returns an error if the scrolling region lim-
173 its extend outside the window.
175 X/Open does not define any error conditions. This imple-
176 mentation returns an error if the window pointer is null.
180 <H2>PORTABILITY</H2><PRE>
181 These functions are described in the XSI Curses standard,
184 The XSI Curses standard is ambiguous on the question of
185 whether <STRONG>raw</STRONG>() should disable the CRLF translations con-
186 trolled by <STRONG>nl</STRONG>() and <STRONG>nonl</STRONG>(). BSD curses did turn off these
187 translations; AT&T curses (at least as late as SVr1) did
188 not. We choose to do so, on the theory that a programmer
189 requesting raw input wants a clean (ideally 8-bit clean)
190 connection that the operating system will not alter.
192 Some historic curses implementations had, as an undocu-
193 mented feature, the ability to do the equivalent of
194 <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
195 <STRONG>scr)</STRONG>. This will not work under ncurses.
197 Earlier System V curses implementations specified that
198 with <STRONG>scrollok</STRONG> enabled, any window modification triggering
199 a scroll also forced a physical refresh. XSI Curses does
200 not require this, and <STRONG>ncurses</STRONG> avoids doing it to perform
201 better vertical-motion optimization at <STRONG>wrefresh</STRONG> time.
203 The XSI Curses standard does not mention that the cursor
204 should be made invisible as a side-effect of <STRONG>leaveok</STRONG>.
205 SVr4 curses documentation does this, but the code does
206 not. Use <STRONG>curs_set</STRONG> to make the cursor invisible.
211 Note that <STRONG>clearok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> and
212 <STRONG>setscrreg</STRONG> may be macros.
214 The <STRONG>immedok</STRONG> routine is useful for windows that are used as
219 <H2>SEE ALSO</H2><PRE>
220 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_addch.3x.html">curs_addch(3x)</A></STRONG>, <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>,
221 <STRONG><A HREF="curs_initscr.3x.html">curs_initscr(3x)</A></STRONG>, <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>,
222 <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
226 <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
230 Man(1) output converted with
231 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>