curs_clear.3x.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. </PRE>
  45. <H2>NAME</H2><PRE>
  46. <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, <STRONG>wclrtobot</STRONG>,
  47. <STRONG>clrtoeol</STRONG>, <STRONG>wclrtoeol</STRONG> - clear all or part of a <STRONG>curses</STRONG> window
  48. </PRE>
  49. <H2>SYNOPSIS</H2><PRE>
  50. <STRONG>#</STRONG> <STRONG>include</STRONG> <STRONG>&lt;curses.h&gt;</STRONG>
  51. <STRONG>int</STRONG> <STRONG>erase(void);</STRONG>
  52. <STRONG>int</STRONG> <STRONG>werase(WINDOW</STRONG> <STRONG>*win);</STRONG>
  53. <STRONG>int</STRONG> <STRONG>clear(void);</STRONG>
  54. <STRONG>int</STRONG> <STRONG>wclear(WINDOW</STRONG> <STRONG>*win);</STRONG>
  55. <STRONG>int</STRONG> <STRONG>clrtobot(void);</STRONG>
  56. <STRONG>int</STRONG> <STRONG>wclrtobot(WINDOW</STRONG> <STRONG>*win);</STRONG>
  57. <STRONG>int</STRONG> <STRONG>clrtoeol(void);</STRONG>
  58. <STRONG>int</STRONG> <STRONG>wclrtoeol(WINDOW</STRONG> <STRONG>*win);</STRONG>
  59. </PRE>
  60. <H2>DESCRIPTION</H2><PRE>
  61. The <STRONG>erase</STRONG> and <STRONG>werase</STRONG> routines copy blanks to every posi-
  62. tion in the window, clearing the screen.
  63. The <STRONG>clear</STRONG> and <STRONG>wclear</STRONG> routines are like <STRONG>erase</STRONG> and <STRONG>werase</STRONG>,
  64. but they also call <STRONG>clearok</STRONG>, so that the screen is cleared
  65. completely on the next call to <STRONG>wrefresh</STRONG> for that window
  66. and repainted from scratch.
  67. The <STRONG>clrtobot</STRONG> and <STRONG>wclrtobot</STRONG> routines erase from the cursor
  68. to the end of screen. That is, they erase all lines below
  69. the cursor in the window. Also, the current line to the
  70. right of the cursor, inclusive, is erased.
  71. The <STRONG>clrtoeol</STRONG> and <STRONG>wclrtoeol</STRONG> routines erase the current line
  72. to the right of the cursor, inclusive, to the end of the
  73. current line.
  74. Blanks created by erasure have the current background ren-
  75. dition (as set by <STRONG>wbkgdset</STRONG>) merged into them.
  76. </PRE>
  77. <H2>RETURN VALUE</H2><PRE>
  78. All routines return the integer <STRONG>OK</STRONG> on success and <STRONG>ERR</STRONG> on
  79. failure. The SVr4.0 manual says "or a non-negative inte-
  80. ger if <STRONG>immedok</STRONG> is set", but this appears to be an error.
  81. X/Open defines no error conditions. In this implementa-
  82. tion, functions using a window pointer parameter return an
  83. error if it is null.
  84. </PRE>
  85. <H2>NOTES</H2><PRE>
  86. Note that <STRONG>erase</STRONG>, <STRONG>werase</STRONG>, <STRONG>clear</STRONG>, <STRONG>wclear</STRONG>, <STRONG>clrtobot</STRONG>, and <STRONG>clr-</STRONG>
  87. <STRONG>toeol</STRONG> may be macros.
  88. </PRE>
  89. <H2>PORTABILITY</H2><PRE>
  90. These functions are described in the XSI Curses standard,
  91. Issue 4. The standard specifies that they return <STRONG>ERR</STRONG> on
  92. failure, but specifies no error conditions.
  93. Some historic curses implementations had, as an undocu-
  94. mented feature, the ability to do the equivalent of
  95. <STRONG>clearok(...,</STRONG> <STRONG>1)</STRONG> by saying <STRONG>touchwin(stdscr)</STRONG> or <STRONG>clear(std-</STRONG>
  96. <STRONG>scr)</STRONG>. This will not work under ncurses.
  97. This implementation, and others such as Solaris, sets the
  98. current position to 0,0 after erasing via <STRONG>werase()</STRONG> and
  99. <STRONG>wclear()</STRONG>. That fact is not documented in other implemen-
  100. tations, and may not be true of implementations which were
  101. not derived from SVr4 source.
  102. Not obvious from the description, most implementations
  103. clear the screen after <STRONG>wclear</STRONG> even for a subwindow or de-
  104. rived window. If you do not want to clear the screen dur-
  105. ing the next <STRONG>wrefresh</STRONG>, use <STRONG>werase</STRONG> instead.
  106. </PRE>
  107. <H2>SEE ALSO</H2><PRE>
  108. <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>
  109. <STRONG><A HREF="curs_clear.3x.html">curs_clear(3x)</A></STRONG>
  110. </PRE>
  111. <HR>
  112. <ADDRESS>
  113. Man(1) output converted with
  114. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  115. </ADDRESS>
  116. </BODY>
  117. </HTML>