]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/curs_clear.3x.html
ncurses 6.5 - patch 20240608
[ncurses.git] / doc / html / man / curs_clear.3x.html
1 <!--
2   ****************************************************************************
3   * Copyright 2018-2023,2024 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.50 2024/05/25 20:10:58 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 2024-05-25 ncurses 6.5 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 2024-05-25 ncurses 6.5 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 <EM>curses</EM> 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
74        window, 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 <STRONG>ERR</STRONG> if it is null
104
105        <STRONG>o</STRONG>   <STRONG>wclrtoeol</STRONG> returns an error if the cursor position is about to wrap.
106
107
108 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
109        Note that <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clrtoeol</STRONG>  may  be
110        macros.
111
112
113 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
114        These functions are described in X/Open Curses, Issue 4.
115
116        The  SVr4.0  manual  says  that these functions could return "or a non-
117        negative integer if <STRONG>immedok</STRONG> is set", referring to the  return-value  of
118        <STRONG>wrefresh</STRONG>.  In that implementation, <STRONG>wrefresh</STRONG> would return a count of the
119        number of characters written to the terminal.
120
121        Some historic curses implementations had, as an  undocumented  feature,
122        the  ability  to  do  the  equivalent  of  <STRONG>clearok(...,</STRONG>  <STRONG>1)</STRONG>  by  saying
123        <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(stdscr)</STRONG>.  This will not work under <EM>ncurses</EM>.
124
125        This implementation, and others  such  as  Solaris,  sets  the  current
126        position  to 0,0 after erasing via <STRONG>werase</STRONG> and <STRONG>wclear</STRONG>.  That fact is not
127        documented  in  other  implementations,  and  may  not   be   true   of
128        implementations which were not derived from SVr4 source.
129
130        Not obvious from the description, most implementations clear the screen
131        after <STRONG>wclear</STRONG> even for a subwindow or derived window.   If  you  do  not
132        want to clear the screen during the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
133
134
135 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
136        <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>
137
138
139
140 ncurses 6.5                       2024-05-25                    <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
141 </PRE>
142 <div class="nav">
143 <ul>
144 <li><a href="#h2-NAME">NAME</a></li>
145 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
146 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
147 <ul>
148 <li><a href="#h3-erase_werase">erase, werase</a></li>
149 <li><a href="#h3-clear_wclear">clear, wclear</a></li>
150 <li><a href="#h3-clrtobot_wclrtobot">clrtobot, wclrtobot</a></li>
151 <li><a href="#h3-clrtoeol_wclrtoeol">clrtoeol, wclrtoeol</a></li>
152 </ul>
153 </li>
154 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
155 <li><a href="#h2-NOTES">NOTES</a></li>
156 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
157 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>
158 </ul>
159 </div>
160 </BODY>
161 </HTML>