1curs_outopts(3X) curs_outopts(3X)
2
3
4
6 clearok, idlok, idcok, immedok, leaveok, setscrreg, wsetscrreg,
7 scrollok - curses output options
8
10 #include <curses.h>
11
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 scrollok(WINDOW *win, bool bf);
18
19 int setscrreg(int top, int bot);
20 int wsetscrreg(WINDOW *win, int top, int bot);
21
23 These routines set options that change the style of output within curs‐
24 es. All options are initially FALSE, unless otherwise stated. It is
25 not necessary to turn these options off before calling endwin(3X).
26
27 clearok
28 If clearok is called with TRUE as argument, the next call to wrefresh
29 with this window will clear the screen completely and redraw the entire
30 screen from scratch. This is useful when the contents of the screen
31 are uncertain, or in some cases for a more pleasing visual effect. If
32 the win argument to clearok is the global variable curscr, the next
33 call to wrefresh with any window causes the screen to be cleared and
34 repainted from scratch.
35
36 idlok
37 If idlok is called with TRUE as second argument, curses considers using
38 the hardware insert/delete line feature of terminals so equipped.
39 Calling idlok with FALSE as second argument disables use of line inser‐
40 tion and deletion. This option should be enabled only if the applica‐
41 tion needs insert/delete line, for example, for a screen editor. It is
42 disabled by default because insert/delete line tends to be visually an‐
43 noying when used in applications where it is not really needed. If in‐
44 sert/delete line cannot be used, curses redraws the changed portions of
45 all lines.
46
47 idcok
48 If idcok is called with FALSE as second argument, curses no longer con‐
49 siders using the hardware insert/delete character feature of terminals
50 so equipped. Use of character insert/delete is enabled by default.
51 Calling idcok with TRUE as second argument re-enables use of character
52 insertion and deletion.
53
54 immedok
55 If immedok is called with TRUE as argument, any change in the window
56 image, such as the ones caused by waddch, wclrtobot, wscrl, etc., auto‐
57 matically cause a call to wrefresh. However, it may degrade perfor‐
58 mance considerably, due to repeated calls to wrefresh. It is disabled
59 by default.
60
61 leaveok
62 Normally, the hardware cursor is left at the location of the window
63 cursor being refreshed. The leaveok option allows the cursor to be
64 left wherever the update happens to leave it. It is useful for appli‐
65 cations where the cursor is not used, since it reduces the need for
66 cursor motions.
67
68 scrollok
69 The scrollok option controls what happens when the cursor of a window
70 is moved off the edge of the window or scrolling region, either as a
71 result of a newline action on the bottom line, or typing the last char‐
72 acter of the last line. If disabled, (bf is FALSE), the cursor is left
73 on the bottom line. If enabled, (bf is TRUE), the window is scrolled
74 up one line (Note that to get the physical scrolling effect on the ter‐
75 minal, it is also necessary to call idlok).
76
77 setscrreg/wsetscrreg
78 The setscrreg and wsetscrreg routines allow the application programmer
79 to set a software scrolling region in a window. The top and bot param‐
80 eters are the line numbers of the top and bottom margin of the
81 scrolling region. (Line 0 is the top line of the window.) If this op‐
82 tion and scrollok are enabled, an attempt to move off the bottom margin
83 line causes all lines in the scrolling region to scroll one line in the
84 direction of the first line. Only the text of the window is scrolled.
85 (Note that this has nothing to do with the use of a physical scrolling
86 region capability in the terminal, like that in the VT100. If idlok is
87 enabled and the terminal has either a scrolling region or insert/delete
88 line capability, they will probably be used by the output routines.)
89
91 The functions setscrreg and wsetscrreg return OK upon success and ERR
92 upon failure. All other routines that return an integer always return
93 OK.
94
95 X/Open Curses does not define any error conditions.
96
97 In this implementation,
98
99 • those functions that have a window pointer will return an error if
100 the window pointer is null
101
102 • wsetscrreg returns an error if the scrolling region limits extend
103 outside the window.
104
105 X/Open does not define any error conditions. This implementation re‐
106 turns an error if the window pointer is null.
107
109 These functions are described in the XSI Curses standard, Issue 4.
110
111 From the outset, ncurses used nl/nonl to control the conversion of new‐
112 lines to carriage return/line-feed on output as well as input. XSI
113 Curses documents only the use of these functions for input. This dif‐
114 ference arose from converting the pcurses source (which used ioctl
115 calls with the sgttyb structure) to termios (i.e., the POSIX terminal
116 interface). In the former, both input and output were controlled via a
117 single option CRMOD, while the latter separates these features. Be‐
118 cause that conversion interferes with output optimization, nl/nonl were
119 amended after ncurses 6.2 to eliminate their effect on output.
120
121 Some historic curses implementations had, as an undocumented feature,
122 the ability to do the equivalent of clearok(..., 1) by saying touch‐
123 win(stdscr) or clear(stdscr). This will not work under ncurses.
124
125 Earlier System V curses implementations specified that with scrollok
126 enabled, any window modification triggering a scroll also forced a
127 physical refresh. XSI Curses does not require this, and ncurses avoids
128 doing it to perform better vertical-motion optimization at wrefresh
129 time.
130
131 The XSI Curses standard does not mention that the cursor should be made
132 invisible as a side-effect of leaveok. SVr4 curses documentation does
133 this, but the code does not. Use curs_set to make the cursor invisi‐
134 ble.
135
137 Note that clearok, leaveok, scrollok, idcok, and setscrreg may be
138 macros.
139
140 The immedok routine is useful for windows that are used as terminal em‐
141 ulators.
142
144 curses(3X), curs_addch(3X), curs_clear(3X), curs_initscr(3X),
145 curs_scroll(3X), curs_refresh(3X), curs_variables(3X).
146
147
148
149 curs_outopts(3X)