]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_clear.3x.html
ncurses 6.4 - patch 20230617
[ncurses.git] / doc / html / man / curs_clear.3x.html
1 <!--
2   ****************************************************************************
3   * Copyright 2018-2021,2022 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.28 2022/11/26 16:23:47 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 2022-11-26 ncurses 6.4 Library calls</TITLE>
38 <link rel="author" href="mailto:bug-ncurses@gnu.org">
39
40 </HEAD>
41 <BODY>
42 <H1 class="no-header">curs_clear 3x 2022-11-26 ncurses 6.4 Library calls</H1>
43 <PRE>
44 <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>                   Library calls                  <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>#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>*</STRONG><EM>win</EM><STRONG>);</STRONG>
59
60        <STRONG>int</STRONG> <STRONG>clear(void);</STRONG>
61        <STRONG>int</STRONG> <STRONG>wclear(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
62
63        <STRONG>int</STRONG> <STRONG>clrtobot(void);</STRONG>
64        <STRONG>int</STRONG> <STRONG>wclrtobot(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
65
66        <STRONG>int</STRONG> <STRONG>clrtoeol(void);</STRONG>
67        <STRONG>int</STRONG> <STRONG>wclrtoeol(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG>
68
69
70 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
71
72 </PRE><H3><a name="h3-erase_werase">erase/werase</a></H3><PRE>
73        The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to every position in the win-
74        dow, clearing the screen.
75
76        Blanks created by erasure have the current background rendition (as set
77        by <STRONG><A HREF="curs_bkgd.3x.html">wbkgdset(3x)</A></STRONG>) merged into them.
78
79
80 </PRE><H3><a name="h3-clear_wclear">clear/wclear</a></H3><PRE>
81        The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>, but they  also
82        call  <STRONG><A HREF="curs_outopts.3x.html">clearok(3x)</A></STRONG>, so that the screen is cleared completely on the next
83        call to <STRONG>wrefresh</STRONG> for that window and repainted from scratch.
84
85
86 </PRE><H3><a name="h3-clrtobot_wclrtobot">clrtobot/wclrtobot</a></H3><PRE>
87        The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor to the end of
88        screen.   That is, they erase all lines below the cursor in the window.
89        Also, the current line to  the  right  of  the  cursor,  inclusive,  is
90        erased.
91
92
93 </PRE><H3><a name="h3-clrtoeol_wclrtoeol">clrtoeol/wclrtoeol</a></H3><PRE>
94        The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line to the right
95        of the cursor, inclusive, to the end of the current line.
96
97
98 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
99        All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on failure.
100
101        X/Open defines no error conditions.  In this implementation,
102
103        <STRONG>o</STRONG>   functions using a window pointer parameter return an error if it is
104            null
105
106        <STRONG>o</STRONG>   <STRONG>wclrtoeol</STRONG> returns an error if the cursor position is about to wrap.
107
108
109 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
110        Note  that  <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clrtoeol</STRONG> may be
111        macros.
112
113
114 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
115        These functions are described in the XSI Curses standard, Issue 4.  The
116        standard  specifies  that  they return <STRONG>ERR</STRONG> on failure, but specifies no
117        error conditions.
118
119        The SVr4.0 manual says that these functions could return  "a  non-nega-
120        tive  integer  if <STRONG><A HREF="curs_outopts.3x.html">immedok(3x)</A></STRONG> is set", referring to the return-value of
121        <STRONG>wrefresh</STRONG>.  In that implementation, <STRONG>wrefresh</STRONG> would return a count of the
122        number of characters written to the terminal.
123
124        Some  historic  curses implementations had, as an undocumented feature,
125        the ability to do the equivalent of <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG>  by  saying  <STRONG>touch-</STRONG>
126        <STRONG>win(stdscr)</STRONG> or <STRONG>clear(stdscr)</STRONG>.  This will not work under ncurses.
127
128        This implementation, and others such as Solaris, sets the current posi-
129        tion to 0,0 after erasing via <STRONG>werase</STRONG> and <STRONG>wclear</STRONG>.  That fact is not doc-
130        umented  in  other  implementations, and may not be true of implementa-
131        tions which were not derived from SVr4 source.
132
133        Not obvious from the description, most implementations clear the screen
134        after  <STRONG>wclear</STRONG>  even  for  a subwindow or derived window.  If you do not
135        want to clear the screen during the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
136
137
138 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
139        <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>
140
141
142
143 ncurses 6.4                       2022-11-26                    <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
144 </PRE>
145 <div class="nav">
146 <ul>
147 <li><a href="#h2-NAME">NAME</a></li>
148 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
149 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
150 <ul>
151 <li><a href="#h3-erase_werase">erase/werase</a></li>
152 <li><a href="#h3-clear_wclear">clear/wclear</a></li>
153 <li><a href="#h3-clrtobot_wclrtobot">clrtobot/wclrtobot</a></li>
154 <li><a href="#h3-clrtoeol_wclrtoeol">clrtoeol/wclrtoeol</a></li>
155 </ul>
156 </li>
157 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
158 <li><a href="#h2-NOTES">NOTES</a></li>
159 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
160 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
161 </ul>
162 </div>
163 </BODY>
164 </HTML>