1curs_refresh(3X)                                              curs_refresh(3X)
2
3
4

NAME

6       doupdate, redrawwin, refresh, wnoutrefresh, wredrawln, wrefresh -
7       refresh curses windows and lines
8

SYNOPSIS

10       #include <curses.h>
11
12       int refresh(void);
13       int wrefresh(WINDOW *win);
14       int wnoutrefresh(WINDOW *win);
15       int doupdate(void);
16       int redrawwin(WINDOW *win);
17       int wredrawln(WINDOW *win, int beg_line, int num_lines);
18

DESCRIPTION

20   refresh/wrefresh
21       The refresh and wrefresh routines (or wnoutrefresh and  doupdate)  must
22       be called to get actual output to the terminal, as other routines mere‐
23       ly manipulate data structures.  The routine wrefresh copies  the  named
24       window to the physical terminal screen, taking into account what is al‐
25       ready there to do optimizations.  The refresh routine is the same,  us‐
26       ing stdscr as the default window.  Unless leaveok has been enabled, the
27       physical cursor of the terminal is left at the location of  the  cursor
28       for that window.
29
30   wnoutrefresh/doupdate
31       The wnoutrefresh and doupdate routines allow multiple updates with more
32       efficiency than wrefresh alone.  In addition to all the  window  struc‐
33       tures,  curses  keeps  two  data  structures  representing the terminal
34       screen: a physical screen, describing what is actually on  the  screen,
35       and  a  virtual screen, describing what the programmer wants to have on
36       the screen.
37
38       The routine wrefresh works by first calling wnoutrefresh, which  copies
39       the  named  window  to  the  virtual screen, and then calling doupdate,
40       which compares the virtual screen to the physical screen and  does  the
41       actual  update.   If the programmer wishes to output several windows at
42       once, a series of calls to wrefresh results  in  alternating  calls  to
43       wnoutrefresh  and  doupdate,  causing  several  bursts of output to the
44       screen.  By first calling wnoutrefresh for each window, it is then pos‐
45       sible  to  call  doupdate  once, resulting in only one burst of output,
46       with fewer total characters transmitted and less CPU time used.  If the
47       win  argument  to wrefresh is the global variable curscr, the screen is
48       immediately cleared and repainted from scratch.
49
50       The phrase "copies the named window to the virtual screen" above is am‐
51       biguous.   What actually happens is that all touched (changed) lines in
52       the window are copied to the virtual  screen.   This  affects  programs
53       that use overlapping windows; it means that if two windows overlap, you
54       can refresh them in either order and the overlap region will  be  modi‐
55       fied  only  when  it  is  explicitly  changed.  (But see the section on
56       PORTABILITY below for a warning about exploiting this behavior.)
57
58   wredrawln/redrawwin
59       The wredrawln routine indicates to curses that some  screen  lines  are
60       corrupted  and  should  be  thrown away before anything is written over
61       them.  It touches the indicated lines (marking them changed).  The rou‐
62       tine redrawwin touches the entire window.
63

RETURN VALUE

65       Routines  that  return an integer return ERR upon failure, and OK (SVr4
66       only specifies "an integer value other than ERR") upon successful  com‐
67       pletion.
68
69       X/Open does not define any error conditions.  In this implementation
70
71          wnoutrefresh
72               returns  an error if the window pointer is null, or if the win‐
73               dow is really a pad.
74
75          wredrawln
76               returns an error if the associated call to touchln  returns  an
77               error.
78

NOTES

80       Note that refresh and redrawwin may be macros.
81

PORTABILITY

83       The XSI Curses standard, Issue 4 describes these functions.
84
85       Whether  wnoutrefresh  copies to the virtual screen the entire contents
86       of a window or just its changed portions has never been well-documented
87       in  historic  curses  versions (including SVr4).  It might be unwise to
88       rely on either behavior in programs that might have to be  linked  with
89       other curses implementations.  Instead, you can do an explicit touchwin
90       before the wnoutrefresh call to guarantee an entire-contents copy  any‐
91       where.
92

SEE ALSO

94       curses(3X), curs_outopts(3X) curs_variables(3X).
95
96
97
98                                                              curs_refresh(3X)
Impressum