1curs_outopts(3CURSES) Curses Library Functions curs_outopts(3CURSES)
2
3
4
6 curs_outopts, clearok, idlok, idcok, immedok, leaveok, setscrreg,
7 wsetscrreg, scrollok, nl, nonl - curses terminal output option control
8 routines
9
11 cc [ flag ... ] file ... -lcurses [ library ... ]
12 #include <curses.h>
13
14 int clearok(WINDOW *win, bool bf);
15
16
17 int idlok(WINDOW *win, bool bf);
18
19
20 void idcok(WINDOW *win, bool bf);
21
22
23 void immedok(WINDOW *win, bool bf);
24
25
26 int leaveok(WINDOW *win, bool bf);
27
28
29 int setscrreg(int top, int bot);
30
31
32 int wsetscrreg(WINDOW *win, int top, int bot);
33
34
35 int scrollok(WINDOW *win, bool bf);
36
37
38 int nl(void);
39
40
41 int nonl(void);
42
43
45 These routines set options that deal with output within curses. All
46 options are initially FALSE, unless otherwise stated. It is not neces‐
47 sary to turn these options off before calling endwin().
48
49
50 With the clearok() routine, if enabled (bf is TRUE), the next call to
51 wrefresh() with this window will clear the screen completely and redraw
52 the entire screen from scratch. This is useful when the contents of the
53 screen are uncertain, or in some cases for a more pleasing visual
54 effect. If the win argument to clearok() is the global variable
55 curscr(), the next call to wrefresh() with any window causes the screen
56 to be cleared and repainted from scratch.
57
58
59 With the idlok() routine, if enabled (bf is TRUE), curses considers
60 using the hardware insert/delete line feature of terminals so equipped.
61 If disabled (bf is FALSE) , curses very seldom uses this feature. (The
62 insert/delete character feature is always considered.) This option
63 should be enabled only if the application needs insert/delete line, for
64 example, for a screen editor. It is disabled by default because
65 insert/delete line tends to be visually annoying when used in applica‐
66 tions where it isn't really needed. If insert/delete line cannot be
67 used, curses redraws the changed portions of all lines.
68
69
70 With the idcok() routine, if enabled (bf is TRUE), curses considers
71 using the hardware insert/delete character feature of terminals so
72 equipped. This is enabled by default.
73
74
75 With the immedok() routine, if enabled (bf is TRUE), any change in the
76 window image, such as the ones caused by waddch(), wclrtobot(),
77 wscrl(), etc., automatically cause a call to wrefresh(). However, it
78 may degrade the performance considerably, due to repeated calls to wre‐
79 fresh(). It is disabled by default. Normally, the hardware cursor is
80 left at the location of the window cursor being refreshed. The
81 leaveok() option allows the cursor to be left wherever the update hap‐
82 pens to leave it. It is useful for applications where the cursor is not
83 used, since it reduces the need for cursor motions. If possible, the
84 cursor is made invisible when this option is enabled.
85
86
87 The setscrreg() and wsetscrreg() routines allow the application pro‐
88 grammer to set a software scrolling region in a window. top and bot are
89 the line numbers of the top and bottom margin of the scrolling region.
90 (Line 0 is the top line of the window.) If this option and scrollok()
91 are enabled, an attempt to move off the bottom margin line causes all
92 lines in the scrolling region to scroll up one line. Only the text of
93 the window is scrolled. (Note that this has nothing to do with the use
94 of a physical scrolling region capability in the terminal, like that in
95 the VT100. If idlok() is enabled and the terminal has either a
96 scrolling region or insert/delete line capability, they will probably
97 be used by the output routines.)
98
99
100 The scrollok() option controls what happens when the cursor of a window
101 is moved off the edge of the window or scrolling region, either as a
102 result of a newline action on the bottom line, or typing the last char‐
103 acter of the last line. If disabled, (bf is FALSE), the cursor is left
104 on the bottom line. If enabled, (bf is TRUE), wrefresh() is called on
105 the window, and the physical terminal and window are scrolled up one
106 line. (Note that in order to get the physical scrolling effect on the
107 terminal, it is also necessary to call idlok().)
108
109
110 The nl() and nonl() routines control whether newline is translated into
111 carriage return and linefeed on output, and whether return is trans‐
112 lated into newline on input. Initially, the translations do occur. By
113 disabling these translations using nonl(), curses is able to make bet‐
114 ter use of the linefeed capability, resulting in faster cursor motion.
115
117 setscrreg() and wsetscrreg() return OK upon success and ERR upon fail‐
118 ure. All other routines that return an integer always return OK.
119
121 See attributes(5) for descriptions of the following attributes:
122
123
124
125
126 ┌─────────────────────────────┬─────────────────────────────┐
127 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
128 ├─────────────────────────────┼─────────────────────────────┤
129 │MT-Level │Unsafe │
130 └─────────────────────────────┴─────────────────────────────┘
131
133 curs_addch(3CURSES), curs_clear(3CURSES), curs_initscr(3CURSES),
134 curs_refresh(3CURSES), curs_scroll(3CURSES), curses(3CURSES),
135 attributes(5)
136
138 The header <curses.h> automatically includes the headers <stdio.h> and
139 <unctrl.h>.
140
141
142 Note that clearok(), leaveok(), scrollok(), idcok(), nl(), nonl(), and
143 setscrreg() may be macros.
144
145
146 The immedok() routine is useful for windows that are used as terminal
147 emulators.
148
149
150
151SunOS 5.11 31 Dec 1996 curs_outopts(3CURSES)