1curs_outopts(3X)                                              curs_outopts(3X)


6       clearok, idlok, idcok, immedok, leaveok, setscrreg, wsetscrreg,
7       scrollok, nl, nonl - curses output options


10       #include <curses.h>
12       int clearok(WINDOW *win, bool bf);
13       int idlok(WINDOW *win, bool bf);
14       void idcok(WINDOW *win, bool bf);
15       void immedok(WINDOW *win, bool bf);
16       int leaveok(WINDOW *win, bool bf);
17       int setscrreg(int top, int bot);
18       int wsetscrreg(WINDOW *win, int top, int bot);
19       int scrollok(WINDOW *win, bool bf);
20       int nl(void);
21       int nonl(void);


24       These routines set options that change the style of output within curs‐
25       es.   All  options are initially FALSE, unless otherwise stated.  It is
26       not necessary to turn these options off before calling endwin(3X).
28   clearok
29       If clearok is called with TRUE as argument, the next call  to  wrefresh
30       with this window will clear the screen completely and redraw the entire
31       screen from scratch.  This is useful when the contents  of  the  screen
32       are  uncertain, or in some cases for a more pleasing visual effect.  If
33       the win argument to clearok is the global  variable  curscr,  the  next
34       call  to  wrefresh  with any window causes the screen to be cleared and
35       repainted from scratch.
37   idlok
38       If idlok is called with TRUE as second argument, curses considers using
39       the  hardware  insert/delete  line  feature  of  terminals so equipped.
40       Calling idlok with FALSE as second argument disables use of line inser‐
41       tion  and deletion.  This option should be enabled only if the applica‐
42       tion needs insert/delete line, for example, for a screen editor.  It is
43       disabled by default because insert/delete line tends to be visually an‐
44       noying when used in applications where it is not really needed.  If in‐
45       sert/delete line cannot be used, curses redraws the changed portions of
46       all lines.
48   idcok
49       If idcok is called with FALSE as second argument, curses no longer con‐
50       siders  using the hardware insert/delete character feature of terminals
51       so equipped.  Use of character insert/delete  is  enabled  by  default.
52       Calling  idcok with TRUE as second argument re-enables use of character
53       insertion and deletion.
55   immedok
56       If immedok is called with TRUE as argument, any change  in  the  window
57       image, such as the ones caused by waddch, wclrtobot, wscrl, etc., auto‐
58       matically cause a call to wrefresh.  However, it  may  degrade  perfor‐
59       mance  considerably, due to repeated calls to wrefresh.  It is disabled
60       by default.
62   leaveok
63       Normally, the hardware cursor is left at the  location  of  the  window
64       cursor  being  refreshed.   The  leaveok option allows the cursor to be
65       left wherever the update happens to leave it.  It is useful for  appli‐
66       cations  where  the  cursor  is not used, since it reduces the need for
67       cursor motions.
69   setscrreg
70       The setscrreg and wsetscrreg routines allow the application  programmer
71       to set a software scrolling region in a window.  The top and bot param‐
72       eters are the line  numbers  of  the  top  and  bottom  margin  of  the
73       scrolling region.  (Line 0 is the top line of the window.)  If this op‐
74       tion and scrollok are enabled, an attempt to move off the bottom margin
75       line causes all lines in the scrolling region to scroll one line in the
76       direction of the first line.  Only the text of the window is  scrolled.
77       (Note  that this has nothing to do with the use of a physical scrolling
78       region capability in the terminal, like that in the VT100.  If idlok is
79       enabled and the terminal has either a scrolling region or insert/delete
80       line capability, they will probably be used by the output routines.)
82   scrollok
83       The scrollok option controls what happens when the cursor of  a  window
84       is  moved  off  the edge of the window or scrolling region, either as a
85       result of a newline action on the bottom line, or typing the last char‐
86       acter of the last line.  If disabled, (bf is FALSE), the cursor is left
87       on the bottom line.  If enabled, (bf is TRUE), the window  is  scrolled
88       up one line (Note that to get the physical scrolling effect on the ter‐
89       minal, it is also necessary to call idlok).
91   nl, nonl
92       The nl and nonl routines control whether the underlying display  device
93       translates  the return key into newline on input, and whether it trans‐
94       lates newline into return and line-feed on output (in either case,  the
95       call  addch('\n')  does  the  equivalent of return and line feed on the
96       virtual screen).  Initially, these translations do occur.  If you  dis‐
97       able  them  using  nonl,  curses will be able to make better use of the
98       line-feed capability, resulting in faster cursor motion.  Also,  curses
99       will then be able to detect the return key.


102       The  functions  setscrreg and wsetscrreg return OK upon success and ERR
103       upon failure.  All other routines that return an integer always  return
104       OK.
106       X/Open Curses does not define any error conditions.
108       In this implementation, those functions that have a window pointer will
109       return an error if the window pointer is null.
111              wclrtoeol
112                   returns an error if the cursor position is about to wrap.
114              wsetscrreg
115                   returns an error if the scrolling region limits extend out‐
116                   side the window.
118       X/Open  does  not define any error conditions.  This implementation re‐
119       turns an error if the window pointer is null.


122       These functions are described in the XSI Curses standard, Issue 4.
124       The XSI Curses standard is ambiguous on the  question  of  whether  raw
125       should  disable  the  CRLF translations controlled by nl and nonl.  BSD
126       curses did turn off these translations; AT&T curses (at least  as  late
127       as  SVr1) did not.  We choose to do so, on the theory that a programmer
128       requesting raw input wants a clean  (ideally  8-bit  clean)  connection
129       that the operating system will not alter.
131       Some  historic  curses implementations had, as an undocumented feature,
132       the ability to do the equivalent of clearok(..., 1)  by  saying  touch‐
133       win(stdscr) or clear(stdscr).  This will not work under ncurses.
135       Earlier  System  V  curses implementations specified that with scrollok
136       enabled, any window modification triggering  a  scroll  also  forced  a
137       physical refresh.  XSI Curses does not require this, and ncurses avoids
138       doing it to perform better  vertical-motion  optimization  at  wrefresh
139       time.
141       The XSI Curses standard does not mention that the cursor should be made
142       invisible as a side-effect of leaveok.  SVr4 curses documentation  does
143       this,  but  the code does not.  Use curs_set to make the cursor invisi‐
144       ble.


147       Note that clearok, leaveok, scrollok, idcok, nl, nonl and setscrreg may
148       be macros.
150       The immedok routine is useful for windows that are used as terminal em‐
151       ulators.


154       curses(3X), curs_addch(3X), curs_clear(3X), curs_initscr(3X),
155       curs_scroll(3X), curs_refresh(3X), curs_variables(3X).
159                                                              curs_outopts(3X)