1curs_refresh(3CURSES)      Curses Library Functions      curs_refresh(3CURSES)
2
3
4

NAME

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

SYNOPSIS

10       cc [ flag ... ] file ... -lcurses [ library ... ]
11       #include <curses.h>
12
13       int refresh(void);
14
15
16       int wrefresh(WINDOW *win);
17
18
19       int wnoutrefresh(WINDOW *win);
20
21
22       int doupdate(void);
23
24
25       int redrawwin(WINDOW *win);
26
27
28       int wredrawln(WINDOW *win, int beg_line, int num_lines);
29
30

DESCRIPTION

32       The refresh() and wrefresh()  routines  (or  wnoutrefresh()  and  doup‐
33       date()) must be called to get any output on the terminal, as other rou‐
34       tines merely manipulate data structures. The routine wrefresh()  copies
35       the  named  window to the physical terminal screen, taking into account
36       what is already there in order to do optimizations. The refresh()  rou‐
37       tine  is the same, using stdscr as the default window. Unless leaveok()
38       has been enabled, the physical cursor of the terminal is  left  at  the
39       location of the cursor for that window.
40
41
42       The  wnoutrefresh() and doupdate() routines allow multiple updates with
43       more efficiency than wrefresh() alone. In addition to  all  the  window
44       structures,  curses keeps two data structures representing the terminal
45       screen: a physical screen, describing what is actually on  the  screen,
46       and  a  virtual screen, describing what the programmer wants to have on
47       the screen.
48
49
50       The routine wrefresh() works by  first  calling  wnoutrefresh(),  which
51       copies  the  named window to the virtual screen, and then calling doup‐
52       date(), which compares the virtual screen to the  physical  screen  and
53       does the actual update. If the programmer wishes to output several win‐
54       dows at once, a series of calls to wrefresh()  results  in  alternating
55       calls  to wnoutrefresh() and doupdate(), causing several bursts of out‐
56       put to the screen. By first calling wnoutrefresh() for each window,  it
57       is  then  possible to call doupdate() once, resulting in only one burst
58       of output, with fewer total characters transmitted and  less  CPU  time
59       used. If the  win argument to wrefresh() is the global variable curscr,
60       the screen is immediately cleared and repainted from scratch.
61
62
63       The redrawwin() routine indicates to curses that some screen lines  are
64       corrupted  and  should  be  thrown away before anything is written over
65       them. These routines could be used for programs such as editors,  which
66       want  a command to redraw some part of the screen or the entire screen.
67       The routine redrawln() is preferred over redrawwin() where a noisy com‐
68       munication line exists and redrawing the entire window could be subject
69       to even more communication noise. Just redrawing  several lines  offers
70       the possibility that they would show up unblemished.
71

RETURN VALUES

73       All  routines  return the integer ERR upon failure and an integer value
74       other than ERR upon successful completion.
75

ATTRIBUTES

77       See attributes(5) for descriptions of the following attributes:
78
79
80
81
82       ┌─────────────────────────────┬─────────────────────────────┐
83       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
84       ├─────────────────────────────┼─────────────────────────────┤
85       │MT-Level                     │Unsafe                       │
86       └─────────────────────────────┴─────────────────────────────┘
87

SEE ALSO

89       curs_outopts(3CURSES), curses(3CURSES), attributes(5)
90

NOTES

92       The header <curses.h> automatically includes the headers  <stdio.h> and
93       <unctrl.h>.
94
95
96       Note that refresh() and redrawwin() may be macros.
97
98
99
100SunOS 5.11                        31 Dec 1996            curs_refresh(3CURSES)
Impressum