ncurses 6.2 - patch 20200425
[ncurses.git] / doc / html / man / curs_clear.3x.html
1 <!-- 
2   ****************************************************************************
3   * Copyright 2018,2020 Thomas E. Dickey                                     *
4   * Copyright 1998-2010,2016 Free Software Foundation, Inc.                  *
5   *                                                                          *
6   * Permission is hereby granted, free of charge, to any person obtaining a  *
7   * copy of this software and associated documentation files (the            *
8   * "Software"), to deal in the Software without restriction, including      *
9   * without limitation the rights to use, copy, modify, merge, publish,      *
10   * distribute, distribute with modifications, sublicense, and/or sell       *
11   * copies of the Software, and to permit persons to whom the Software is    *
12   * furnished to do so, subject to the following conditions:                 *
13   *                                                                          *
14   * The above copyright notice and this permission notice shall be included  *
15   * in all copies or substantial portions of the Software.                   *
16   *                                                                          *
17   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
18   * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
19   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
20   * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
21   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
22   * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
23   * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
24   *                                                                          *
25   * Except as contained in this notice, the name(s) of the above copyright   *
26   * holders shall not be used in advertising or otherwise to promote the     *
27   * sale, use or other dealings in this Software without prior written       *
28   * authorization.                                                           *
29   ****************************************************************************
30   * @Id: curs_clear.3x,v 1.17 2020/02/02 23:34:34 tom Exp @
31 -->
32 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
33 <HTML>
34 <HEAD>
35 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
36 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
37 <TITLE>curs_clear 3x</TITLE>
38 <link rel="author" href="mailto:bug-ncurses@gnu.org">
39 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
40 </HEAD>
41 <BODY>
42 <H1 class="no-header">curs_clear 3x</H1>
43 <PRE>
44 <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>                                                  <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
45
46
47
48
49 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
50        <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, <STRONG>wclrtobot</STRONG>, <STRONG>clrtoeol</STRONG>, <STRONG>wclrtoeol</STRONG>
51        - clear all or part of a <STRONG>curses</STRONG> window
52
53
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55        <STRONG>#</STRONG> <STRONG>include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
56
57        <STRONG>int</STRONG> <STRONG>erase(void);</STRONG>
58        <STRONG>int</STRONG> <STRONG>werase(WINDOW</STRONG> <STRONG>*win);</STRONG>
59        <STRONG>int</STRONG> <STRONG>clear(void);</STRONG>
60        <STRONG>int</STRONG> <STRONG>wclear(WINDOW</STRONG> <STRONG>*win);</STRONG>
61        <STRONG>int</STRONG> <STRONG>clrtobot(void);</STRONG>
62        <STRONG>int</STRONG> <STRONG>wclrtobot(WINDOW</STRONG> <STRONG>*win);</STRONG>
63        <STRONG>int</STRONG> <STRONG>clrtoeol(void);</STRONG>
64        <STRONG>int</STRONG> <STRONG>wclrtoeol(WINDOW</STRONG> <STRONG>*win);</STRONG>
65
66
67 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
68        The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to every position in the win-
69        dow, clearing the screen.
70
71        The  <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>, but they also
72        call <STRONG>clearok</STRONG>, so that the screen is cleared completely on the next call
73        to <STRONG>wrefresh</STRONG> for that window and repainted from scratch.
74
75        The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor to the end of
76        screen.  That is, they erase all lines below the cursor in the  window.
77        Also,  the  current  line  to  the  right  of the cursor, inclusive, is
78        erased.
79
80        The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line to the right
81        of the cursor, inclusive, to the end of the current line.
82
83        Blanks created by erasure have the current background rendition (as set
84        by <STRONG>wbkgdset</STRONG>) merged into them.
85
86
87 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
88        All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.   The
89        SVr4.0  manual  says "or a non-negative integer if <STRONG>immedok</STRONG> is set", but
90        this appears to be an error.
91
92        X/Open defines no error conditions.  In this implementation,  functions
93        using a window pointer parameter return an error if it is null.
94
95
96 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
97        Note  that  <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clrtoeol</STRONG> may be
98        macros.
99
100
101 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
102        These functions are described in the XSI Curses standard, Issue 4.  The
103        standard  specifies  that  they return <STRONG>ERR</STRONG> on failure, but specifies no
104        error conditions.
105
106        Some historic curses implementations had, as an  undocumented  feature,
107        the  ability  to  do the equivalent of <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touch-</STRONG>
108        <STRONG>win(stdscr)</STRONG> or <STRONG>clear(stdscr)</STRONG>.  This will not work under ncurses.
109
110        This implementation, and others such as Solaris, sets the current posi-
111        tion to 0,0 after erasing via <STRONG>werase</STRONG> and <STRONG>wclear</STRONG>.  That fact is not doc-
112        umented in other implementations, and may not be  true  of  implementa-
113        tions which were not derived from SVr4 source.
114
115        Not obvious from the description, most implementations clear the screen
116        after <STRONG>wclear</STRONG> even for a subwindow or derived window.   If  you  do  not
117        want to clear the screen during the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
118
119
120 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
121        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>
122
123
124
125                                                                 <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
126 </PRE>
127 <div class="nav">
128 <ul>
129 <li><a href="#h2-NAME">NAME</a></li>
130 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
131 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li>
132 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
133 <li><a href="#h2-NOTES">NOTES</a></li>
134 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
135 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
136 </ul>
137 </div>
138 </BODY>
139 </HTML>