]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_clear.3x
ncurses 5.7 - patch 20101023
[ncurses.git] / man / curs_clear.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2007,2010 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.13 2010/10/02 23:19:07 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.  That is, they erase all lines below the cursor in the window.
74 Also, the current line to the right of the cursor, inclusive, is erased.
75 .PP
76 The \fBclrtoeol\fR and \fBwclrtoeol\fR routines erase the current line
77 to the right of the cursor, inclusive, to the end of the current line.
78 .PP
79 Blanks created by erasure have the current background rendition (as set
80 by \fBwbkgdset\fR) merged into them.
81 .SH RETURN VALUE
82 All routines return the integer \fBOK\fR on success and \fBERR\fP on failure.
83 The SVr4.0 manual says "or a
84 non-negative integer if \fBimmedok\fR is set", but this appears to be an error.
85 .PP
86 X/Open defines no error conditions.
87 In this implementation,
88 functions using a window pointer parameter return an error if it is null.
89 .SH NOTES
90 Note that \fBerase\fR, \fBwerase\fR, \fBclear\fR, \fBwclear\fR,
91 \fBclrtobot\fR, and \fBclrtoeol\fR may be macros.
92 .SH PORTABILITY
93 These functions are described in the XSI Curses standard, Issue 4.  The
94 standard specifies that they return \fBERR\fR on failure, but specifies no
95 error conditions.
96 .PP
97 Some historic curses implementations had, as an undocumented feature, the
98 ability to do the equivalent of \fBclearok(..., 1)\fR by saying
99 \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR.  This will not work under
100 ncurses.
101 .PP
102 This implementation, and others such as Solaris,
103 sets the current position to 0,0 after erasing
104 via \fBwerase()\fP and \fBwclear()\fP.
105 That fact is not documented in other implementations,
106 and may not be true of implementations
107 which were not derived from SVr4 source.
108 .PP
109 Not obvious from the description,
110 most implementations clear the screen after \fBwclear\fP
111 even for a subwindow or derived window.
112 If you do not want to clear the screen during the next \fBwrefresh\fP,
113 use \fBwerase\fP instead.
114 .SH SEE ALSO
115 \fBcurses\fR(3X),
116 \fBcurs_outopts\fR(3X),
117 \fBcurs_refresh\fR(3X),
118 \fBcurs_variables\fR(3X)
119 .\"#
120 .\"# The following sets edit modes for GNU EMACS
121 .\"# Local Variables:
122 .\"# mode:nroff
123 .\"# fill-column:79
124 .\"# End: