]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_outopts.3x.html
ncurses 5.7 - patch 20100109
[ncurses.git] / doc / html / man / curs_outopts.3x.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <!-- 
3   ****************************************************************************
4   * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc.              *
5   *                                                                          *
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:                 *
13   *                                                                          *
14   * The above copyright notice and this permission notice shall be included  *
15   * in all copies or substantial portions of the Software.                   *
16   *                                                                          *
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.                               *
24   *                                                                          *
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       *
28   * authorization.                                                           *
29   ****************************************************************************
30   * @Id: curs_outopts.3x,v 1.21 2007/06/02 20:40:07 tom Exp @
31 -->
32 <HTML>
33 <HEAD>
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">
37 </HEAD>
38 <BODY>
39 <H1>curs_outopts 3x</H1>
40 <HR>
41 <PRE>
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>
44
45
46
47
48 </PRE>
49 <H2>NAME</H2><PRE>
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
52
53
54 </PRE>
55 <H2>SYNOPSIS</H2><PRE>
56        <STRONG>#include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
57
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>
68
69
70 </PRE>
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>.
76
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.
85
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
96        lines.
97
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-
103        tion and deletion.
104
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-
110        fault.
111
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.
117
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.   <EM>top</EM>  and <EM>bot</EM> are the line numbers of the top and
121        bottom margin of the scrolling region.  (Line 0 is the top
122        line  of the window.)  If this option and <STRONG>scrollok</STRONG> are en-
123        abled, an attempt to move off the bottom margin line caus-
124        es all lines in the scrolling region to scroll one line in
125        the direction of the first line.  Only  the  text  of  the
126        window  is  scrolled.   (Note  that this has nothing to do
127        with the use of a physical scrolling region capability  in
128        the terminal, like that in the VT100.  If <STRONG>idlok</STRONG> is enabled
129        and the terminal has either  a  scrolling  region  or  in-
130        sert/delete line capability, they will probably be used by
131        the output routines.)
132
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>).
142
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
152        the return key.
153
154
155 </PRE>
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>.
160
161        X/Open does not define any error conditions.
162
163        In this implementation, those functions that have a window
164        pointer will return an error  if  the  window  pointer  is
165        null.
166
167               <STRONG>wclrtoeol</STRONG>
168                    returns  an  error  if  the cursor position is
169                    about to wrap.
170
171               <STRONG>wsetscrreg</STRONG>
172                    returns an error if the scrolling region  lim-
173                    its extend outside the window.
174
175        X/Open  does not define any error conditions.  This imple-
176        mentation returns an error if the window pointer is  null.
177
178
179 </PRE>
180 <H2>PORTABILITY</H2><PRE>
181        These  functions are described in the XSI Curses standard,
182        Issue 4.
183
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&amp;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.
191
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.
196
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.
202
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.
207
208
209 </PRE>
210 <H2>NOTES</H2><PRE>
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.
213
214        The <STRONG>immedok</STRONG> routine is useful for windows that are used as
215        terminal emulators.
216
217
218 </PRE>
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
223
224
225                                                        <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>
226 </PRE>
227 <HR>
228 <ADDRESS>
229 Man(1) output converted with
230 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
231 </ADDRESS>
232 </BODY>
233 </HTML>