1curs_pad(3X) curs_pad(3X)
2
3
4
6 newpad, subpad, prefresh, pnoutrefresh, pechochar, pecho_wchar - create
7 and display curses pads
8
10 #include <curses.h>
11
12 WINDOW *newpad(int nlines, int ncols);
13 WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
14 int begin_y, int begin_x);
15 int prefresh(WINDOW *pad, int pminrow, int pmincol,
16 int sminrow, int smincol, int smaxrow, int smaxcol);
17 int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
18 int sminrow, int smincol, int smaxrow, int smaxcol);
19 int pechochar(WINDOW *pad, chtype ch);
20 int pecho_wchar(WINDOW *pad, const cchar_t *wch);
21
23 The newpad routine creates and returns a pointer to a new pad data
24 structure with the given number of lines, nlines, and columns, ncols.
25 A pad is like a window, except that it is not restricted by the screen
26 size, and is not necessarily associated with a particular part of the
27 screen. Pads can be used when a large window is needed, and only a
28 part of the window will be on the screen at one time. Automatic re‐
29 freshes of pads (e.g., from scrolling or echoing of input) do not oc‐
30 cur. It is not legal to call wrefresh with a pad as an argument; the
31 routines prefresh or pnoutrefresh should be called instead. Note that
32 these routines require additional parameters to specify the part of the
33 pad to be displayed and the location on the screen to be used for the
34 display.
35
36 The subpad routine creates and returns a pointer to a subwindow within
37 a pad with the given number of lines, nlines, and columns, ncols. Un‐
38 like subwin, which uses screen coordinates, the window is at position
39 (begin_x, begin_y) on the pad. The window is made in the middle of the
40 window orig, so that changes made to one window affect both windows.
41 During the use of this routine, it will often be necessary to call
42 touchwin or touchline on orig before calling prefresh.
43
44 The prefresh and pnoutrefresh routines are analogous to wrefresh and
45 wnoutrefresh except that they relate to pads instead of windows. The
46 additional parameters are needed to indicate what part of the pad and
47 screen are involved. pminrow and pmincol specify the upper left-hand
48 corner of the rectangle to be displayed in the pad. sminrow, smincol,
49 smaxrow, and smaxcol specify the edges of the rectangle to be displayed
50 on the screen. The lower right-hand corner of the rectangle to be dis‐
51 played in the pad is calculated from the screen coordinates, since the
52 rectangles must be the same size. Both rectangles must be entirely
53 contained within their respective structures. Negative values of pmin‐
54 row, pmincol, sminrow, or smincol are treated as if they were zero.
55
56 The pechochar routine is functionally equivalent to a call to addch
57 followed by a call to refresh, a call to waddch followed by a call to
58 wrefresh, or a call to waddch followed by a call to prefresh. The
59 knowledge that only a single character is being output is taken into
60 consideration and, for non-control characters, a considerable perfor‐
61 mance gain might be seen by using these routines instead of their
62 equivalents. In the case of pechochar, the last location of the pad on
63 the screen is reused for the arguments to prefresh.
64
65 The pecho_wchar function is the analogous wide-character form of pe‐
66 chochar. It outputs one character to a pad and immediately refreshes
67 the pad. It does this by a call to wadd_wch followed by a call to pre‐
68 fresh.
69
71 Routines that return an integer return ERR upon failure and OK (SVr4
72 only specifies "an integer value other than ERR") upon successful com‐
73 pletion.
74
75 Routines that return pointers return NULL on error, and set errno to
76 ENOMEM.
77
78 X/Open does not define any error conditions. In this implementation
79
80 prefresh and pnoutrefresh
81 return an error if the window pointer is null, or if the
82 window is not really a pad or if the area to refresh ex‐
83 tends off-screen or if the minimum coordinates are greater
84 than the maximum.
85
86 pechochar
87 returns an error if the window is not really a pad, and the
88 associated call to wechochar returns an error.
89
90 pecho_wchar
91 returns an error if the window is not really a pad, and the
92 associated call to wecho_wchar returns an error.
93
95 Note that pechochar may be a macro.
96
98 The XSI Curses standard, Issue 4 describes these functions.
99
101 curses(3X), curs_refresh(3X), curs_touch(3X), curs_addch(3X).
102
103
104
105 curs_pad(3X)