]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_clear.3x
ncurses 6.1 - patch 20191221
[ncurses.git] / man / curs_clear.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2016,2018 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_clear.3x,v 1.16 2018/07/28 21:34:06 tom Exp $
30 .TH curs_clear 3X ""
31 .na
32 .hy 0
33 .SH NAME
34 \fBerase\fR,
35 \fBwerase\fR,
36 \fBclear\fR,
37 \fBwclear\fR,
38 \fBclrtobot\fR,
39 \fBwclrtobot\fR,
40 \fBclrtoeol\fR,
41 \fBwclrtoeol\fR \- clear all or part of a \fBcurses\fR window
42 .ad
43 .hy
44 .SH SYNOPSIS
45 \fB# include <curses.h>\fR
46 .sp
47 \fBint erase(void);\fR
48 .br
49 \fBint werase(WINDOW *win);\fR
50 .br
51 \fBint clear(void);\fR
52 .br
53 \fBint wclear(WINDOW *win);\fR
54 .br
55 \fBint clrtobot(void);\fR
56 .br
57 \fBint wclrtobot(WINDOW *win);\fR
58 .br
59 \fBint clrtoeol(void);\fR
60 .br
61 \fBint wclrtoeol(WINDOW *win);\fR
62 .br
63 .SH DESCRIPTION
64 The \fBerase\fR and \fBwerase\fR routines copy blanks to every
65 position in the window, clearing the screen.
66 .PP
67 The \fBclear\fR and \fBwclear\fR routines are like \fBerase\fR and
68 \fBwerase\fR, but they also call \fBclearok\fR, so that the screen is
69 cleared completely on the next call to \fBwrefresh\fR for that window
70 and repainted from scratch.
71 .PP
72 The \fBclrtobot\fR and \fBwclrtobot\fR routines erase from the cursor to the
73 end of screen.
74 That is, they erase all lines below the cursor in the window.
75 Also, the current line to the right of the cursor, inclusive, is erased.
76 .PP
77 The \fBclrtoeol\fR and \fBwclrtoeol\fR routines erase the current line
78 to the right of the cursor, inclusive, to the end of the current line.
79 .PP
80 Blanks created by erasure have the current background rendition (as set
81 by \fBwbkgdset\fR) merged into them.
82 .SH RETURN VALUE
83 All routines return the integer \fBOK\fR on success and \fBERR\fP on failure.
84 The SVr4.0 manual says "or a
85 non-negative integer if \fBimmedok\fR is set", but this appears to be an error.
86 .PP
87 X/Open defines no error conditions.
88 In this implementation,
89 functions using a window pointer parameter return an error if it is null.
90 .SH NOTES
91 Note that \fBerase\fR, \fBwerase\fR, \fBclear\fR, \fBwclear\fR,
92 \fBclrtobot\fR, and \fBclrtoeol\fR may be macros.
93 .SH PORTABILITY
94 These functions are described in the XSI Curses standard, Issue 4.
95 The
96 standard specifies that they return \fBERR\fR on failure, but specifies no
97 error conditions.
98 .PP
99 Some historic curses implementations had, as an undocumented feature, the
100 ability to do the equivalent of \fBclearok(..., 1)\fR by saying
101 \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR.
102 This will not work under
103 ncurses.
104 .PP
105 This implementation, and others such as Solaris,
106 sets the current position to 0,0 after erasing
107 via \fBwerase\fP and \fBwclear\fP.
108 That fact is not documented in other implementations,
109 and may not be true of implementations
110 which were not derived from SVr4 source.
111 .PP
112 Not obvious from the description,
113 most implementations clear the screen after \fBwclear\fP
114 even for a subwindow or derived window.
115 If you do not want to clear the screen during the next \fBwrefresh\fP,
116 use \fBwerase\fP instead.
117 .SH SEE ALSO
118 \fBcurses\fR(3X),
119 \fBcurs_outopts\fR(3X),
120 \fBcurs_refresh\fR(3X),
121 \fBcurs_variables\fR(3X)