The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


doupdate, refresh, wnoutrefresh, wrefresh - refresh windows and lines


#include <curses.h>

int doupdate(void);

int refresh(void);

int wnoutrefresh(WINDOW *win);

int wrefresh(WINDOW *win);


The refresh() and wrefresh() functions refresh the current or specified window. The functions position the terminal's cursor at the cursor position of the window, except that if the leaveok() mode has been enabled, they may leave the cursor at an arbitrary position.

The wnoutrefresh() function determines which parts of the terminal may need updating. The doupdate() function sends to the terminal the commands to perform any required changes.


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


No errors are defined.


Refreshing an entire window is typically more efficient than refreshing several subwindows separately. An efficient sequence is to call wnoutrefresh() on each subwindow that has changed, followed by a call to doupdate(), which updates the terminal.

The refresh() or wrefresh() function (or wnoutrefresh() followed by doupdate()) must be called to send output to the terminal, as other Curses functions merely manipulate data structures.


clearok(), redrawwin(), <curses.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]