Refreshes windows and lines.
Curses Library (libcurses.a)
#include <curses.h>
int doupdate(void);
int refresh(void);
int wnoutrefresh(WINDOW *win);
int wrefresh(WINDOW *win);
The refresh and wrefresh subroutines refresh the current or specified window. The subroutines 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 subroutine determines which parts of the terminal may need updating.
The doupdate subroutine sends to the terminal the commands to perform any required changes.
Item | Description |
---|---|
*win | Specifies the window to be refreshed. |
Upon successful completion, these subroutines return OK. Otherwise, they return ERR.
For the doupdate or wnoutrefresh subroutine:
To update the user-defined windows my_window1 and my_window2, enter:
WINDOW *my_window1, my_window2;
wnoutrefresh(my_window1);
wnoutrefresh(my_window2);
doupdate();
For the refresh or wrefresh subroutine:
refresh();
WINDOW *my_window;
wrefresh(my_window);
wrefresh(curscr);
This subroutine is useful if the terminal becomes garbled for any reason.