]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_outopts.3x.html
ncurses 5.9 - patch 20150214
[ncurses.git] / doc / html / man / curs_outopts.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright (c) 1998-2007,2010 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.25 2010/12/04 18:38:55 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>curs_outopts 3x</H1>
42 <HR>
43 <PRE>
44 <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>                                       <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
45
46
47
48
49 </PRE>
50 <H2><a name="h2-NAME">NAME</a></H2><PRE>
51        <STRONG>clearok</STRONG>, <STRONG>idlok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>immedok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>setscrreg</STRONG>,
52        <STRONG>wsetscrreg</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG> - <STRONG>curses</STRONG> output options
53
54
55 </PRE>
56 <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
57        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
58
59        <STRONG>int</STRONG> <STRONG>clearok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
60        <STRONG>int</STRONG> <STRONG>idlok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
61        <STRONG>void</STRONG> <STRONG>idcok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
62        <STRONG>void</STRONG> <STRONG>immedok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
63        <STRONG>int</STRONG> <STRONG>leaveok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
64        <STRONG>int</STRONG> <STRONG>setscrreg(int</STRONG> <STRONG>top,</STRONG> <STRONG>int</STRONG> <STRONG>bot);</STRONG>
65        <STRONG>int</STRONG> <STRONG>wsetscrreg(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>top,</STRONG> <STRONG>int</STRONG> <STRONG>bot);</STRONG>
66        <STRONG>int</STRONG> <STRONG>scrollok(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>bool</STRONG> <STRONG>bf);</STRONG>
67        <STRONG>int</STRONG> <STRONG>nl(void);</STRONG>
68        <STRONG>int</STRONG> <STRONG>nonl(void);</STRONG>
69
70
71 </PRE>
72 <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
73        These routines set options that change the style of output
74        within  <STRONG>curses</STRONG>.   All  options are initially <STRONG>FALSE</STRONG>, unless
75        otherwise stated.  It is not necessary to turn  these  op-
76        tions off before calling <STRONG>endwin</STRONG>.
77
78        If  <STRONG>clearok</STRONG> is called with <STRONG>TRUE</STRONG> as argument, the next call
79        to <STRONG>wrefresh</STRONG> with this window will clear  the  screen  com-
80        pletely  and  redraw the entire screen from scratch.  This
81        is useful when the contents of the screen  are  uncertain,
82        or  in  some  cases for a more pleasing visual effect.  If
83        the <EM>win</EM> argument to <STRONG>clearok</STRONG> is the global variable <STRONG>curscr</STRONG>,
84        the  next  call  to  <STRONG>wrefresh</STRONG>  with  any window causes the
85        screen to be cleared and repainted from scratch.
86
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        If <STRONG>idcok</STRONG> is called with <STRONG>FALSE</STRONG> as second  argument,  <STRONG>curses</STRONG>
100        no longer considers using the hardware insert/delete char-
101        acter feature of terminals so equipped.  Use of  character
102        insert/delete  is  enabled by default.  Calling <STRONG>idcok</STRONG> with
103        <STRONG>TRUE</STRONG> as second argument re-enables use of character inser-
104        tion and deletion.
105
106        If  <STRONG>immedok</STRONG> is called with <STRONG>TRUE</STRONG> <STRONG>as</STRONG> <STRONG>argument</STRONG>, any change in
107        the window image, such as the ones caused by <STRONG>waddch,</STRONG> <STRONG>wclr-</STRONG>
108        <STRONG>tobot,</STRONG>  <STRONG>wscrl</STRONG>,  etc.,  automatically  cause a call to <STRONG>wre-</STRONG>
109        <STRONG>fresh</STRONG>.  However, it may degrade performance  considerably,
110        due  to repeated calls to <STRONG>wrefresh</STRONG>.  It is disabled by de-
111        fault.
112
113        Normally, the hardware cursor is left at the  location  of
114        the window cursor being refreshed.  The <STRONG>leaveok</STRONG> option al-
115        lows the cursor to be left wherever the update happens  to
116        leave  it.  It is useful for applications where the cursor
117        is not used, since it reduces the need for cursor motions.
118
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.  The <EM>top</EM> and <EM>bot</EM> parameters are the  line  numbers
122        of  the  top  and  bottom  margin of the scrolling region.
123        (Line 0 is the top line of the window.)   If  this  option
124        and  <STRONG>scrollok</STRONG> are enabled, an attempt to move off the bot-
125        tom margin line causes all lines in the  scrolling  region
126        to  scroll  one  line  in the direction of the first line.
127        Only the text of the window is scrolled.  (Note that  this
128        has nothing to do with the use of a physical scrolling re-
129        gion capability in the terminal, like that in  the  VT100.
130        If  <STRONG>idlok</STRONG>  is  enabled  and  the  terminal  has  either  a
131        scrolling region or insert/delete  line  capability,  they
132        will probably be used by the output routines.)
133
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>).
143
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
153        the return key.
154
155
156 </PRE>
157 <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></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>.
161
162        X/Open does not define any error conditions.
163
164        In this implementation, those functions that have a window
165        pointer  will  return  an  error  if the window pointer is
166        null.
167
168               <STRONG>wclrtoeol</STRONG>
169                    returns an error if  the  cursor  position  is
170                    about to wrap.
171
172               <STRONG>wsetscrreg</STRONG>
173                    returns  an error if the scrolling region lim-
174                    its extend outside the window.
175
176        X/Open does not define any error conditions.  This  imple-
177        mentation returns an error if the window pointer is null.
178
179
180 </PRE>
181 <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
182        These  functions are described in the XSI Curses standard,
183        Issue 4.
184
185        The XSI Curses standard is ambiguous on  the  question  of
186        whether  <STRONG>raw</STRONG>()  should  disable the CRLF translations con-
187        trolled by <STRONG>nl</STRONG>() and <STRONG>nonl</STRONG>().  BSD curses did turn off these
188        translations;  AT&amp;T  curses (at least as late as SVr1) did
189        not.  We choose to do so, on the theory that a  programmer
190        requesting  raw  input wants a clean (ideally 8-bit clean)
191        connection that the operating system will not alter.
192
193        Some historic curses implementations had,  as  an  undocu-
194        mented  feature,  the  ability  to  do  the  equivalent of
195        <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG>  or  <STRONG>clear(std-</STRONG>
196        <STRONG>scr)</STRONG>.  This will not work under ncurses.
197
198        Earlier  System  V  curses  implementations specified that
199        with <STRONG>scrollok</STRONG> enabled, any window modification  triggering
200        a  scroll also forced a physical refresh.  XSI Curses does
201        not require this, and <STRONG>ncurses</STRONG> avoids doing it  to  perform
202        better vertical-motion optimization at <STRONG>wrefresh</STRONG> time.
203
204        The  XSI  Curses standard does not mention that the cursor
205        should be made invisible  as  a  side-effect  of  <STRONG>leaveok</STRONG>.
206        SVr4  curses  documentation  does  this, but the code does
207        not.  Use <STRONG>curs_set</STRONG> to make the cursor invisible.
208
209
210 </PRE>
211 <H2><a name="h2-NOTES">NOTES</a></H2><PRE>
212        Note that <STRONG>clearok</STRONG>, <STRONG>leaveok</STRONG>, <STRONG>scrollok</STRONG>, <STRONG>idcok</STRONG>, <STRONG>nl</STRONG>, <STRONG>nonl</STRONG>  and
213        <STRONG>setscrreg</STRONG> may be macros.
214
215        The <STRONG>immedok</STRONG> routine is useful for windows that are used as
216        terminal emulators.
217
218
219 </PRE>
220 <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
221        <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>,
222        <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>,
223        <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>.
224
225
226
227                                                        <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
228 </PRE>
229 <div class="nav">
230 <ul>
231 <li><a href="#h2-NAME">NAME</a></li>
232 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
233 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
234 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
235 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
236 <li><a href="#h2-NOTES">NOTES</a></li>
237 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
238 </ul>
239 </div>
240 </BODY>
241 </HTML>