[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

clear, erase, wclear or werase Subroutine

Purpose

Clears a window.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

int clear(void);

int erase(void);


int wclear(WINDOW *win);

int werase(WINDOW *win);

Description

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.

Parameters

*win Specifies the window to clear.

Return Values

Upon successful completion, these subroutines return OK. Otherwise, they return ERR.

Examples

For the clear and wclear subroutines:

  1. To clear stdscr and set a clear flag for the next call to the refresh subroutine, enter:

    clear();
  2. To clear the user-defined window my_window and set a clear flag for the next call to the wrefresh subroutine, enter:

    WINDOW *my_window;
    wclear(my_window);
    waddstr (my_window, "This will be cleared.");
    wrefresh (my_window);
  3. To erase the standard screen structure, enter:

    erase();
  4. To erase the user-defined window my_window, enter:

    WINDOW *my_window;
    werase (my_window);
    Note
    After the wrefresh, the window will be cleared completely. You will not see the string "This will be cleared."

For the erase and werase subroutines:

  1. To erase the standard screen structure, enter:

    erase();
  2. To erase the user-defined window my_window, enter:

    WINDOW *my_window;
    werase(my_window);

Related Information

The doupdate (doupdate, refresh, wnoutrefresh, or wrefresh Subroutines) subroutine, erase (erase or werase Subroutine) and werase (erase or werase Subroutine) subroutines, clearok (clearok, idlok, leaveok, scrollok, setscrreg or wsetscrreg Subroutine) subroutine, refresh (refresh or wrefresh Subroutine) subroutine.

Curses Overview for Programming, List of Curses Subroutines, Manipulating Characters with Curses in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]