[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, 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);

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The doupdate subroutine, erase and werase subroutines, clearok subroutine, refresh subroutine.

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


[ Previous | Next | Contents | Glossary | Home | Search ]