]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/html/man/curs_refresh.3x.html
ncurses 5.0
[ncurses.git] / Ada95 / html / man / curs_refresh.3x.html
1 <HTML>
2 <BODY>
3 <PRE>
4        <STRONG>refresh</STRONG>, <STRONG>wrefresh</STRONG>, <STRONG>wnoutrefresh</STRONG>, <STRONG>doupdate</STRONG>, <STRONG>redrawwin</STRONG>, <STRONG>wre-</STRONG>
5        <STRONG>drawln</STRONG> - refresh <STRONG>curses</STRONG> windows and lines
6
7
8 </PRE>
9 <H2>SYNOPSIS</H2><PRE>
10        <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
11
12        <STRONG>int</STRONG> <STRONG>refresh(void);</STRONG>
13        <STRONG>int</STRONG> <STRONG>wrefresh(WINDOW</STRONG> <STRONG>*win);</STRONG>
14        <STRONG>int</STRONG> <STRONG>wnoutrefresh(WINDOW</STRONG> <STRONG>*win);</STRONG>
15        <STRONG>int</STRONG> <STRONG>doupdate(void);</STRONG>
16        <STRONG>int</STRONG> <STRONG>redrawwin(WINDOW</STRONG> <STRONG>*win);</STRONG>
17        <STRONG>int</STRONG> <STRONG>wredrawln(WINDOW</STRONG> <STRONG>*win,</STRONG> <STRONG>int</STRONG> <STRONG>beg_line,</STRONG> <STRONG>int</STRONG> <STRONG>num_lines);</STRONG>
18
19
20 </PRE>
21 <H2>DESCRIPTION</H2><PRE>
22        The <STRONG>refresh</STRONG> and <STRONG>wrefresh</STRONG>  routines  (or  <STRONG>wnoutrefresh</STRONG>  and
23        <STRONG>doupdate</STRONG>)  must be called to get actual output to the ter-
24        minal, as other routines  merely  manipulate  data  struc-
25        tures.   The  routine  <STRONG>wrefresh</STRONG> copies the named window to
26        the physical terminal screen, taking into account what  is
27        already  there  in order to do optimizations.  The <STRONG>refresh</STRONG>
28        routine is the same, using <STRONG>stdscr</STRONG> as the  default  window.
29        Unless  <STRONG>leaveok</STRONG>  has  been enabled, the physical cursor of
30        the terminal is left at the location  of  the  cursor  for
31        that window.
32
33        The  <STRONG>wnoutrefresh</STRONG>  and  <STRONG>doupdate</STRONG>  routines  allow multiple
34        updates with more  efficiency  than  <STRONG>wrefresh</STRONG>  alone.   In
35        addition  to  all  the window structures, <STRONG>curses</STRONG> keeps two
36        data structures representing the terminal screen: a physi-
37        cal screen, describing what is actually on the screen, and
38        a virtual screen, describing what the programmer wants  to
39        have on the screen.
40
41        The  routine <STRONG>wrefresh</STRONG> works by first calling <STRONG>wnoutrefresh</STRONG>,
42        which copies the named window to the virtual  screen,  and
43        then  calling  <STRONG>doupdate</STRONG>, which compares the virtual screen
44        to the physical screen and does the actual update.  If the
45        programmer  wishes  to  output  several windows at once, a
46        series of calls to <STRONG>wrefresh</STRONG> results in  alternating  calls
47        to  <STRONG>wnoutrefresh</STRONG>  and  <STRONG>doupdate</STRONG>, causing several bursts of
48        output to the screen.  By first calling  <STRONG>wnoutrefresh</STRONG>  for
49        each  window,  it  is then possible to call <STRONG>doupdate</STRONG> once,
50        resulting in only one burst of output,  with  fewer  total
51        characters transmitted and less CPU time used.  If the <EM>win</EM>
52        argument to <STRONG>wrefresh</STRONG> is the global  variable  <STRONG>curscr</STRONG>,  the
53        screen  is immediately cleared and repainted from scratch.
54
55        The phrase "copies the named window to the virtual screen"
56        above  is  ambiguous.   What  actually happens is that all
57        <EM>touched</EM> (changed) lines in the window are  copied  to  the
58        virtual  screen.   This affects programs that use overlap-
59        ping windows; it means that if two  windows  overlap,  you
60        see  the  section on <STRONG>PORTABILITY</STRONG> below for a warning about
61        exploiting this behavior.)
62
63        The <STRONG>wredrawln</STRONG> routine indicates to <STRONG>curses</STRONG> that some screen
64        lines  are corrupted and should be thrown away before any-
65        thing is written over  them.   It  touches  the  indicated
66        lines  (marking  them  changed).   The routine <STRONG>redrawwin</STRONG>()
67        touches the entire window.
68
69
70 </PRE>
71 <H2>RETURN VALUE</H2><PRE>
72        Routines that return an integer return <STRONG>ERR</STRONG>  upon  failure,
73        and  <STRONG>OK</STRONG>  (SVr4 only specifies "an integer value other than
74        <STRONG>ERR</STRONG>") upon successful completion.
75
76
77 </PRE>
78 <H2>NOTES</H2><PRE>
79        Note that <STRONG>refresh</STRONG> and <STRONG>redrawwin</STRONG> may be macros.
80
81
82 </PRE>
83 <H2>PORTABILITY</H2><PRE>
84        The XSI Curses standard, Issue  4  describes  these  func-
85        tions.
86
87        Whether  <STRONG>wnoutrefresh()</STRONG>  copies  to the virtual screen the
88        entire contents of a window or just its  changed  portions
89        has never been well-documented in historic curses versions
90        (including SVr4).  It might be unwise to  rely  on  either
91        behavior  in  programs  that  might have to be linked with
92        other curses implementations.   Instead,  you  can  do  an
93        explicit  <STRONG>touchwin()</STRONG>  before  the  <STRONG>wnoutrefresh()</STRONG>  call to
94        guarantee an entire-contents copy anywhere.
95
96
97 </PRE>
98 <H2>SEE ALSO</H2><PRE>
99        <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3X)</A></STRONG>
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120 </PRE>
121 </BODY>
122 </HTML>