Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> |
| 2 | <!-- |
| 3 | **************************************************************************** |
| 4 | * Copyright (c) 1998-2005,2007 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.11 2007/12/29 15:58:38 tom Exp @ |
| 31 | --> |
| 32 | <HTML> |
| 33 | <HEAD> |
| 34 | <TITLE>curs_clear 3x</TITLE> |
| 35 | <link rev=made href="mailto:bug-ncurses@gnu.org"> |
| 36 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 37 | </HEAD> |
| 38 | <BODY> |
| 39 | <H1>curs_clear 3x</H1> |
| 40 | <HR> |
| 41 | <PRE> |
| 42 | <!-- Manpage converted by man2html 3.0.1 --> |
| 43 | <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG> <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG> |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | </PRE> |
| 49 | <H2>NAME</H2><PRE> |
| 50 | <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, <STRONG>wclrtobot</STRONG>, |
| 51 | <STRONG>clrtoeol</STRONG>, <STRONG>wclrtoeol</STRONG> - clear all or part of a <STRONG>curses</STRONG> window |
| 52 | |
| 53 | |
| 54 | </PRE> |
| 55 | <H2>SYNOPSIS</H2><PRE> |
| 56 | <STRONG>#</STRONG> <STRONG>include</STRONG> <STRONG><curses.h></STRONG> |
| 57 | |
| 58 | <STRONG>int</STRONG> <STRONG>erase(void);</STRONG> |
| 59 | <STRONG>int</STRONG> <STRONG>werase(WINDOW</STRONG> <STRONG>*win);</STRONG> |
| 60 | <STRONG>int</STRONG> <STRONG>clear(void);</STRONG> |
| 61 | <STRONG>int</STRONG> <STRONG>wclear(WINDOW</STRONG> <STRONG>*win);</STRONG> |
| 62 | <STRONG>int</STRONG> <STRONG>clrtobot(void);</STRONG> |
| 63 | <STRONG>int</STRONG> <STRONG>wclrtobot(WINDOW</STRONG> <STRONG>*win);</STRONG> |
| 64 | <STRONG>int</STRONG> <STRONG>clrtoeol(void);</STRONG> |
| 65 | <STRONG>int</STRONG> <STRONG>wclrtoeol(WINDOW</STRONG> <STRONG>*win);</STRONG> |
| 66 | |
| 67 | |
| 68 | </PRE> |
| 69 | <H2>DESCRIPTION</H2><PRE> |
| 70 | The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to every posi- |
| 71 | tion in the window, clearing the screen. |
| 72 | |
| 73 | The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>, |
| 74 | but they also call <STRONG>clearok</STRONG>, so that the screen is cleared |
| 75 | completely on the next call to <STRONG>wrefresh</STRONG> for that window |
| 76 | and repainted from scratch. |
| 77 | |
| 78 | The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor |
| 79 | to the end of screen. That is, they erase all lines below |
| 80 | the cursor in the window. Also, the current line to the |
| 81 | right of the cursor, inclusive, is erased. |
| 82 | |
| 83 | The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line |
| 84 | to the right of the cursor, inclusive, to the end of the |
| 85 | current line. |
| 86 | |
| 87 | Blanks created by erasure have the current background ren- |
| 88 | dition (as set by <STRONG>wbkgdset</STRONG>) merged into them. |
| 89 | |
| 90 | |
| 91 | </PRE> |
| 92 | <H2>RETURN VALUE</H2><PRE> |
| 93 | All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on |
| 94 | failure. The SVr4.0 manual says "or a non-negative inte- |
| 95 | ger if <STRONG>immedok</STRONG> is set", but this appears to be an error. |
| 96 | |
| 97 | X/Open defines no error conditions. In this implementa- |
| 98 | tion, functions using a window pointer parameter return an |
| 99 | error if it is null. |
| 100 | |
| 101 | |
| 102 | </PRE> |
| 103 | <H2>NOTES</H2><PRE> |
| 104 | Note that <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clr-</STRONG> |
| 105 | <STRONG>toeol</STRONG> may be macros. |
| 106 | |
| 107 | |
| 108 | </PRE> |
| 109 | <H2>PORTABILITY</H2><PRE> |
| 110 | These functions are described in the XSI Curses standard, |
| 111 | Issue 4. The standard specifies that they return <STRONG>ERR</STRONG> on |
| 112 | failure, but specifies no error conditions. |
| 113 | |
| 114 | Some historic curses implementations had, as an undocu- |
| 115 | mented feature, the ability to do the equivalent of |
| 116 | <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG> |
| 117 | <STRONG>scr)</STRONG>. This will not work under ncurses. |
| 118 | |
| 119 | This implementation, and others such as Solaris, sets the |
| 120 | current position to 0,0 after erasing via <STRONG>werase()</STRONG> and |
| 121 | <STRONG>wclear()</STRONG>. That fact is not documented in other implemen- |
| 122 | tations, and may not be true of implementations which were |
| 123 | not derived from SVr4 source. |
| 124 | |
| 125 | Not obvious from the description, most implementations |
| 126 | clear the screen after <STRONG>wclear</STRONG> even for a subwindow or de- |
| 127 | rived window. If you do not want to clear the screen dur- |
| 128 | ing the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead. |
| 129 | |
| 130 | |
| 131 | </PRE> |
| 132 | <H2>SEE ALSO</H2><PRE> |
| 133 | <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> |
| 134 | |
| 135 | |
| 136 | |
| 137 | <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG> |
| 138 | </PRE> |
| 139 | <HR> |
| 140 | <ADDRESS> |
| 141 | Man(1) output converted with |
| 142 | <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a> |
| 143 | </ADDRESS> |
| 144 | </BODY> |
| 145 | </HTML> |