]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_outopts.3x.html
ncurses 6.0 - patch 20160326
[ncurses.git] / doc / html / man / curs_outopts.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2010,2015 Free Software Foundation, Inc.              *
4   *                                                                          *
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:                 *
12   *                                                                          *
13   * The above copyright notice and this permission notice shall be included  *
14   * in all copies or substantial portions of the Software.                   *
15   *                                                                          *
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.                               *
23   *                                                                          *
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       *
27   * authorization.                                                           *
28   ****************************************************************************
29   * @Id: curs_outopts.3x,v 1.26 2015/07/21 00:23:43 tom Exp @
30 -->
31 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
32 <HTML>
33 <HEAD>
34 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
35 <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts">
36 <TITLE>curs_outopts 3x</TITLE>
37 <link rev=made href="mailto:bug-ncurses@gnu.org">
38 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
39 </HEAD>
40 <BODY>
41 <H1 class="no-header">curs_outopts 3x</H1>
42 <PRE>
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>
44
45
46
47
48 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
49        <STRONG>clearok</STRONG>, <STRONG>idlok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>immedok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>setscrreg</STRONG>,
50        <STRONG>wsetscrreg</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> - <STRONG>curses</STRONG> output options
51
52
53 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
54        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
55
56        <STRONG>int</STRONG> <STRONG>clearok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
57        <STRONG>int</STRONG> <STRONG>idlok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
58        <STRONG>void</STRONG> <STRONG>idcok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
59        <STRONG>void</STRONG> <STRONG>immedok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
60        <STRONG>int</STRONG> <STRONG>leaveok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
61        <STRONG>int</STRONG> <STRONG>setscrreg(int</STRONG> <EM>top</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>bot</EM><STRONG>);</STRONG>
62        <STRONG>int</STRONG> <STRONG>wsetscrreg(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>top</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>bot</EM><STRONG>);</STRONG>
63        <STRONG>int</STRONG> <STRONG>scrollok(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>bool</STRONG> <EM>bf</EM><STRONG>);</STRONG>
64        <STRONG>int</STRONG> <STRONG>nl(void);</STRONG>
65        <STRONG>int</STRONG> <STRONG>nonl(void);</STRONG>
66
67
68 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
69        These routines set options that change the style of output
70        within  <STRONG>curses</STRONG>.   All  options are initially <STRONG>FALSE</STRONG>, unless
71        otherwise stated.  It is not necessary to turn  these  op-
72        tions off before calling <STRONG>endwin</STRONG>.
73
74
75 </PRE><H3><a name="h3-clearok">clearok</a></H3><PRE>
76        If  <STRONG>clearok</STRONG> is called with <STRONG>TRUE</STRONG> as argument, the next call
77        to <STRONG>wrefresh</STRONG> with this window will clear  the  screen  com-
78        pletely  and  redraw the entire screen from scratch.  This
79        is useful when the contents of the screen  are  uncertain,
80        or  in  some  cases for a more pleasing visual effect.  If
81        the <EM>win</EM> argument to <STRONG>clearok</STRONG> is the global variable <STRONG>curscr</STRONG>,
82        the  next  call  to  <STRONG>wrefresh</STRONG>  with  any window causes the
83        screen to be cleared and repainted from scratch.
84
85
86 </PRE><H3><a name="h3-idlok">idlok</a></H3><PRE>
87        If <STRONG>idlok</STRONG> is called with <STRONG>TRUE</STRONG> as  second  argument,  <STRONG>curses</STRONG>
88        considers using the hardware insert/delete line feature of
89        terminals so equipped.  Calling <STRONG>idlok</STRONG> with <STRONG>FALSE</STRONG> as second
90        argument  disables  use  of  line  insertion and deletion.
91        This option should be  enabled  only  if  the  application
92        needs  insert/delete  line, for example, for a screen edi-
93        tor.  It is disabled by default because insert/delete line
94        tends  to  be  visually annoying when used in applications
95        where it is not really needed.  If insert/delete line can-
96        not  be  used,  <STRONG>curses</STRONG> redraws the changed portions of all
97        lines.
98
99
100 </PRE><H3><a name="h3-idcok">idcok</a></H3><PRE>
101        If <STRONG>idcok</STRONG> is called with <STRONG>FALSE</STRONG> as second  argument,  <STRONG>curses</STRONG>
102        no longer considers using the hardware insert/delete char-
103        acter feature of terminals so equipped.  Use of  character
104        insert/delete  is  enabled by default.  Calling <STRONG>idcok</STRONG> with
105        <STRONG>TRUE</STRONG> as second argument re-enables use of character inser-
106        tion and deletion.
107
108
109 </PRE><H3><a name="h3-immedok">immedok</a></H3><PRE>
110        If  <STRONG>immedok</STRONG> is called with <STRONG>TRUE</STRONG> <STRONG>as</STRONG> <STRONG>argument</STRONG>, any change in
111        the window image, such as the ones caused by <STRONG>waddch,</STRONG> <STRONG>wclr-</STRONG>
112        <STRONG>tobot,</STRONG>  <STRONG>wscrl</STRONG>,  etc.,  automatically  cause a call to <STRONG>wre-</STRONG>
113        <STRONG>fresh</STRONG>.  However, it may degrade performance  considerably,
114        due  to repeated calls to <STRONG>wrefresh</STRONG>.  It is disabled by de-
115        fault.
116
117
118 </PRE><H3><a name="h3-leaveok">leaveok</a></H3><PRE>
119        Normally, the hardware cursor is left at the  location  of
120        the window cursor being refreshed.  The <STRONG>leaveok</STRONG> option al-
121        lows the cursor to be left wherever the update happens  to
122        leave  it.  It is useful for applications where the cursor
123        is not used, since it reduces the need for cursor motions.
124
125
126 </PRE><H3><a name="h3-setscrreg">setscrreg</a></H3><PRE>
127        The <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> routines allow  the  applica-
128        tion  programmer  to  set a software scrolling region in a
129        window.  The <EM>top</EM> and <EM>bot</EM> parameters are the  line  numbers
130        of  the  top  and  bottom  margin of the scrolling region.
131        (Line 0 is the top line of the window.)   If  this  option
132        and  <STRONG>scrollok</STRONG> are enabled, an attempt to move off the bot-
133        tom margin line causes all lines in the  scrolling  region
134        to  scroll  one  line  in the direction of the first line.
135        Only the text of the window is scrolled.  (Note that  this
136        has nothing to do with the use of a physical scrolling re-
137        gion capability in the terminal, like that in  the  VT100.
138        If  <STRONG>idlok</STRONG>  is  enabled  and  the  terminal  has  either  a
139        scrolling region or insert/delete  line  capability,  they
140        will probably be used by the output routines.)
141
142
143 </PRE><H3><a name="h3-scrollok">scrollok</a></H3><PRE>
144        The  <STRONG>scrollok</STRONG> option controls what happens when the cursor
145        of a window is  moved  off  the  edge  of  the  window  or
146        scrolling  region,  either as a result of a newline action
147        on the bottom line, or typing the last  character  of  the
148        last line.  If disabled, (<EM>bf</EM> is <STRONG>FALSE</STRONG>), the cursor is left
149        on the bottom line.  If enabled, (<EM>bf</EM> is <STRONG>TRUE</STRONG>), the  window
150        is  scrolled  up  one  line (Note that to get the physical
151        scrolling effect on the terminal, it is also necessary  to
152        call <STRONG>idlok</STRONG>).
153
154
155 </PRE><H3><a name="h3-nl_-nonl">nl, nonl</a></H3><PRE>
156        The  <STRONG>nl</STRONG>  and  <STRONG>nonl</STRONG> routines control whether the underlying
157        display device translates the return key into  newline  on
158        input,  and  whether it translates newline into return and
159        line-feed on output (in either case, the call  <STRONG>addch('\n')</STRONG>
160        does the equivalent of return and line feed on the virtual
161        screen).  Initially, these translations do occur.  If  you
162        disable  them using <STRONG>nonl</STRONG>, <STRONG>curses</STRONG> will be able to make bet-
163        ter use of the line-feed capability, resulting  in  faster
164        cursor  motion.   Also, <STRONG>curses</STRONG> will then be able to detect
165        the return key.
166
167
168 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
169        The functions <STRONG>setscrreg</STRONG> and <STRONG>wsetscrreg</STRONG> return <STRONG>OK</STRONG> upon suc-
170        cess and <STRONG>ERR</STRONG> upon failure.  All other routines that return
171        an integer always return <STRONG>OK</STRONG>.
172
173        X/Open Curses does not define any error conditions.
174
175        In this implementation, those functions that have a window
176        pointer  will  return  an  error  if the window pointer is
177        null.
178
179               <STRONG>wclrtoeol</STRONG>
180                    returns an error if  the  cursor  position  is
181                    about to wrap.
182
183               <STRONG>wsetscrreg</STRONG>
184                    returns  an error if the scrolling region lim-
185                    its extend outside the window.
186
187        X/Open does not define any error conditions.  This  imple-
188        mentation returns an error if the window pointer is null.
189
190
191 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
192        These  functions are described in the XSI Curses standard,
193        Issue 4.
194
195        The XSI Curses standard is ambiguous on  the  question  of
196        whether  <STRONG>raw</STRONG>()  should  disable the CRLF translations con-
197        trolled by <STRONG>nl</STRONG>() and <STRONG>nonl</STRONG>().  BSD curses did turn off these
198        translations;  AT&amp;T  curses (at least as late as SVr1) did
199        not.  We choose to do so, on the theory that a  programmer
200        requesting  raw  input wants a clean (ideally 8-bit clean)
201        connection that the operating system will not alter.
202
203        Some historic curses implementations had,  as  an  undocu-
204        mented  feature,  the  ability  to  do  the  equivalent of
205        <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG>  or  <STRONG>clear(std-</STRONG>
206        <STRONG>scr)</STRONG>.  This will not work under ncurses.
207
208        Earlier  System  V  curses  implementations specified that
209        with <STRONG>scrollok</STRONG> enabled, any window modification  triggering
210        a  scroll also forced a physical refresh.  XSI Curses does
211        not require this, and <STRONG>ncurses</STRONG> avoids doing it  to  perform
212        better vertical-motion optimization at <STRONG>wrefresh</STRONG> time.
213
214        The  XSI  Curses standard does not mention that the cursor
215        should be made invisible  as  a  side-effect  of  <STRONG>leaveok</STRONG>.
216        SVr4  curses  documentation  does  this, but the code does
217        not.  Use <STRONG>curs_set</STRONG> to make the cursor invisible.
218
219
220 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
221        Note that <STRONG>clearok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG>  and
222        <STRONG>setscrreg</STRONG> may be macros.
223
224        The <STRONG>immedok</STRONG> routine is useful for windows that are used as
225        terminal emulators.
226
227
228 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
229        <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>,
230        <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>,
231        <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
232
233
234
235                                                        <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
236 </PRE>
237 <div class="nav">
238 <ul>
239 <li><a href="#h2-NAME">NAME</a></li>
240 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
241 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
242 <ul>
243 <li><a href="#h3-clearok">clearok</a></li>
244 <li><a href="#h3-idlok">idlok</a></li>
245 <li><a href="#h3-idcok">idcok</a></li>
246 <li><a href="#h3-immedok">immedok</a></li>
247 <li><a href="#h3-leaveok">leaveok</a></li>
248 <li><a href="#h3-setscrreg">setscrreg</a></li>
249 <li><a href="#h3-scrollok">scrollok</a></li>
250 <li><a href="#h3-nl_-nonl">nl, nonl</a></li>
251 </ul>
252 </li>
253 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
254 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
255 <li><a href="#h2-NOTES">NOTES</a></li>
256 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
257 </ul>
258 </div>
259 </BODY>
260 </HTML>