4 <!-- Manpage converted by man2html 3.0.1 -->
8 <B>refresh</B>, <B>wrefresh</B>, <B>wnoutrefresh</B>, <B>doupdate</B>, <B>redrawwin</B>, <B>wre-</B>
9 <B>drawln</B> - refresh <B>curses</B> windows and lines
13 <H2>SYNOPSIS</H2><PRE>
14 <B>#include</B> <B><curses.h></B>
16 <B>int</B> <B>refresh(void);</B>
17 <B>int</B> <B>wrefresh(WINDOW</B> <B>*win);</B>
18 <B>int</B> <B>wnoutrefresh(WINDOW</B> <B>*win);</B>
19 <B>int</B> <B>doupdate(void);</B>
20 <B>int</B> <B>redrawwin(WINDOW</B> <B>*win);</B>
21 <B>int</B> <B>wredrawln(WINDOW</B> <B>*win,</B> <B>int</B> <B>beg_line,</B> <B>int</B> <B>num_lines);</B>
25 <H2>DESCRIPTION</H2><PRE>
26 The <B>refresh</B> and <B>wrefresh</B> routines (or <B>wnoutrefresh</B> and
27 <B>doupdate</B>) must be called to get actual output to the ter-
28 minal, as other routines merely manipulate data struc-
29 tures. The routine <B>wrefresh</B> copies the named window to
30 the physical terminal screen, taking into account what is
31 already there in order to do optimizations. The <B>refresh</B>
32 routine is the same, using <B>stdscr</B> as the default window.
33 Unless <B>leaveok</B> has been enabled, the physical cursor of
34 the terminal is left at the location of the cursor for
37 The <B>wnoutrefresh</B> and <B>doupdate</B> routines allow multiple
38 updates with more efficiency than <B>wrefresh</B> alone. In
39 addition to all the window structures, <B>curses</B> keeps two
40 data structures representing the terminal screen: a physi-
41 cal screen, describing what is actually on the screen, and
42 a virtual screen, describing what the programmer wants to
45 The routine <B>wrefresh</B> works by first calling <B>wnoutrefresh</B>,
46 which copies the named window to the virtual screen, and
47 then calling <B>doupdate</B>, which compares the virtual screen
48 to the physical screen and does the actual update. If the
49 programmer wishes to output several windows at once, a
50 series of calls to <B>wrefresh</B> results in alternating calls
51 to <B>wnoutrefresh</B> and <B>doupdate</B>, causing several bursts of
52 output to the screen. By first calling <B>wnoutrefresh</B> for
53 each window, it is then possible to call <B>doupdate</B> once,
54 resulting in only one burst of output, with fewer total
55 characters transmitted and less CPU time used. If the <I>win</I>
56 argument to <B>wrefresh</B> is the global variable <B>curscr</B>, the
57 screen is immediately cleared and repainted from scratch.
59 The phrase "copies the named window to the virtual screen"
60 above is ambiguous. What actually happens is that all
61 <I>touched</I> (changed) lines in the window are copied to the
62 virtual screen. This affects programs that use overlap-
63 ping windows; it means that if two windows overlap, you
64 can refresh them in either order and the overlap region
65 will be modified only when it is explicitly changed. (But
66 see the section on <B>PORTABILITY</B> below for a warning about
67 exploiting this behavior.)
69 The <B>wredrawln</B> routine indicates to <B>curses</B> that some screen
70 lines are corrupted and should be thrown away before any-
71 thing is written over them. It touches the indicated
72 lines (marking them changed). The routine <B>redrawwin</B>()
73 touches the entire window.
77 <H2>RETURN VALUE</H2><PRE>
78 Routines that return an integer return <B>ERR</B> upon failure,
79 and <B>OK</B> (SVr4 only specifies "an integer value other than
80 <B>ERR</B>") upon successful completion.
85 Note that <B>refresh</B> and <B>redrawwin</B> may be macros.
89 <H2>PORTABILITY</H2><PRE>
90 The XSI Curses standard, Issue 4 describes these func-
93 Whether <B>wnoutrefresh()</B> copies to the virtual screen the
94 entire contents of a window or just its changed portions
95 has never been well-documented in historic curses versions
96 (including SVr4). It might be unwise to rely on either
97 behavior in programs that might have to be linked with
98 other curses implementations. Instead, you can do an
99 explicit <B>touchwin()</B> before the <B>wnoutrefresh()</B> call to
100 guarantee an entire-contents copy anywhere.
104 <H2>SEE ALSO</H2><PRE>
105 <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></B>
130 Man(1) output converted with
131 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>