1curs_clear(3X) curs_clear(3X)
2
3
4
6 erase, werase, clear, wclear, clrtobot, wclrtobot, clrtoeol, wclrtoeol
7 - clear all or part of a curses window
8
10 # include <curses.h>
11
12 int erase(void);
13 int werase(WINDOW *win);
14 int clear(void);
15 int wclear(WINDOW *win);
16 int clrtobot(void);
17 int wclrtobot(WINDOW *win);
18 int clrtoeol(void);
19 int wclrtoeol(WINDOW *win);
20
22 The erase and werase routines copy blanks to every position in the win‐
23 dow, clearing the screen.
24
25 The clear and wclear routines are like erase and werase, but they also
26 call clearok, so that the screen is cleared completely on the next call
27 to wrefresh for that window and repainted from scratch.
28
29 The clrtobot and wclrtobot routines erase from the cursor to the end of
30 screen. That is, they erase all lines below the cursor in the window.
31 Also, the current line to the right of the cursor, inclusive, is
32 erased.
33
34 The clrtoeol and wclrtoeol routines erase the current line to the right
35 of the cursor, inclusive, to the end of the current line.
36
37 Blanks created by erasure have the current background rendition (as set
38 by wbkgdset) merged into them.
39
41 All routines return the integer OK on success and ERR on failure. The
42 SVr4.0 manual says "or a non-negative integer if immedok is set", but
43 this appears to be an error.
44
45 X/Open defines no error conditions. In this implementation, functions
46 using a window pointer parameter return an error if it is null.
47
49 Note that erase, werase, clear, wclear, clrtobot, and clrtoeol may be
50 macros.
51
53 These functions are described in the XSI Curses standard, Issue 4. The
54 standard specifies that they return ERR on failure, but specifies no
55 error conditions.
56
57 Some historic curses implementations had, as an undocumented feature,
58 the ability to do the equivalent of clearok(..., 1) by saying touch‐
59 win(stdscr) or clear(stdscr). This will not work under ncurses.
60
61 This implementation, and others such as Solaris, sets the current posi‐
62 tion to 0,0 after erasing via werase() and wclear(). That fact is not
63 documented in other implementations, and may not be true of implementa‐
64 tions which were not derived from SVr4 source.
65
66 Not obvious from the description, most implementations clear the screen
67 after wclear even for a subwindow or derived window. If you do not
68 want to clear the screen during the next wrefresh, use werase instead.
69
71 curses(3X), curs_outopts(3X), curs_refresh(3X), curs_variables(3X)
72
73
74
75 curs_clear(3X)