Clears a window.
Curses Library (libcurses.a)
#include <curses.h>
int clear(void);
int erase(void);
int wclear(WINDOW *win);
int werase(WINDOW *win);
The clear, erase, wclear, and werase subroutines clear every position in the current or specified window.
The clear and wclear subroutines also achieve the same effect as calling the clearok subroutine, so that the window is cleared completely on the next call to the wrefresh subroutine for the window and is redrawn in its entirety.
Item | Description |
---|---|
*win | Specifies the window to clear. |
Upon successful completion, these subroutines return OK. Otherwise, they return ERR.
For the clear and wclear subroutines:
clear();
WINDOW *my_window;
wclear(my_window);
waddstr (my_window, "This will be cleared.");
wrefresh (my_window);
erase();
WINDOW *my_window;
werase (my_window);
For the erase and werase subroutines:
erase();
WINDOW *my_window;
werase(my_window);