1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
3 ****************************************************************************
4 * Copyright (c) 1998-2001,2003 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.18 2003/05/10 20:33:49 jmc 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
75 options 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 isn't 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
112 Normally, the hardware cursor is left at the location of
113 the window cursor being refreshed. The <STRONG>leaveok</STRONG> option
114 allows the cursor to be left wherever the update happens
115 to leave it. It is useful for applications where the cur-
116 sor is not used, since it reduces the need for cursor
119 The <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> routines allow the applica-
120 tion programmer to set a software scrolling region in a
121 window. <EM>top</EM> and <EM>bot</EM> are the line numbers of the top and
122 bottom margin of the scrolling region. (Line 0 is the top
123 line of the window.) If this option and <STRONG>scrollok</STRONG> are
124 enabled, an attempt to move off the bottom margin line
125 causes all lines in the scrolling region to scroll one
126 line in the direction of the first line. Only the text of
127 the window is scrolled. (Note that this has nothing to do
128 with the use of a physical scrolling region capability in
129 the terminal, like that in the VT100. If <STRONG>idlok</STRONG> is enabled
130 and the terminal has either a scrolling region or
131 insert/delete line capability, they will probably be used
132 by the output routines.)
134 The <STRONG>scrollok</STRONG> option controls what happens when the cursor
135 of a window is moved off the edge of the window or
136 scrolling region, either as a result of a newline action
137 on the bottom line, or typing the last character of the
138 last line. If disabled, (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the cursor is left
139 on the bottom line. If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the window
140 is scrolled up one line (Note that to get the physical
141 scrolling effect on the terminal, it is also necessary to
142 call <STRONG>idlok</STRONG>).
144 The <STRONG>nl</STRONG> and <STRONG>nonl</STRONG> routines control whether the underlying
145 display device translates the return key into newline on
146 input, and whether it translates newline into return and
147 line-feed on output (in either case, the call <STRONG>addch('\n')</STRONG>
148 does the equivalent of return and line feed on the virtual
149 screen). Initially, these translations do occur. If you
150 disable them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make bet-
151 ter use of the line-feed capability, resulting in faster
152 cursor motion. Also, <STRONG>curses</STRONG> will then be able to detect
157 <H2>RETURN VALUE</H2><PRE>
158 The functions <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> return <STRONG>OK</STRONG> upon suc-
159 cess and <STRONG>ERR</STRONG> upon failure. All other routines that return
160 an integer always return <STRONG>OK</STRONG>.
164 <H2>PORTABILITY</H2><PRE>
165 These functions are described in the XSI Curses standard,
168 The XSI Curses standard is ambiguous on the question of
169 whether <STRONG>raw</STRONG>() should disable the CRLF translations con-
170 trolled by <STRONG>nl</STRONG>() and <STRONG>nonl</STRONG>(). BSD curses did turn off these
171 translations; AT&T curses (at least as late as SVr1) did
172 not. We choose to do so, on the theory that a programmer
173 requesting raw input wants a clean (ideally 8-bit clean)
174 connection that the operating system does not mess with.
176 Some historic curses implementations had, as an undocu-
177 mented feature, the ability to do the equivalent of
178 <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
179 <STRONG>scr)</STRONG>. This will not work under ncurses.
181 Earlier System V curses implementations specified that
182 with <STRONG>scrollok</STRONG> enabled, any window modification triggering
183 a scroll also forced a physical refresh. XSI Curses does
184 not require this, and <STRONG>ncurses</STRONG> avoids doing it to perform
185 better vertical-motion optimization at <STRONG>wrefresh</STRONG> time.
187 The XSI Curses standard does not mention that the cursor
188 should be made invisible as a side-effect of <STRONG>leaveok</STRONG>.
189 SVr4 curses documentation does this, but the code does
190 not. Use <STRONG>curs_set</STRONG> to make the cursor invisible.
195 Note that <STRONG>clearok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> and
196 <STRONG>setscrreg</STRONG> may be macros.
198 The <STRONG>immedok</STRONG> routine is useful for windows that are used as
203 <H2>SEE ALSO</H2><PRE>
204 <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>,
205 <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>
209 <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
213 Man(1) output converted with
214 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>