4 <STRONG>newpad</STRONG>, <STRONG>subpad</STRONG>, <STRONG>prefresh</STRONG>, <STRONG>pnoutrefresh</STRONG>, <STRONG>pechochar</STRONG> - create
5 and display <STRONG>curses</STRONG> pads
10 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG>
12 <STRONG>WINDOW</STRONG> <STRONG>*newpad(int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols);</STRONG>
13 <STRONG>WINDOW</STRONG> <STRONG>*subpad(WINDOW</STRONG> <STRONG>*orig,</STRONG> <STRONG>int</STRONG> <STRONG>nlines,</STRONG> <STRONG>int</STRONG> <STRONG>ncols,</STRONG>
14 <STRONG>int</STRONG> <STRONG>begin_y,</STRONG> <STRONG>int</STRONG> <STRONG>begin_x);</STRONG>
15 <STRONG>int</STRONG> <STRONG>prefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
16 <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
17 <STRONG>int</STRONG> <STRONG>pnoutrefresh(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>int</STRONG> <STRONG>pminrow,</STRONG> <STRONG>int</STRONG> <STRONG>pmincol,</STRONG>
18 <STRONG>int</STRONG> <STRONG>sminrow,</STRONG> <STRONG>int</STRONG> <STRONG>smincol,</STRONG> <STRONG>int</STRONG> <STRONG>smaxrow,</STRONG> <STRONG>int</STRONG> <STRONG>smaxcol);</STRONG>
19 <STRONG>int</STRONG> <STRONG>pechochar(WINDOW</STRONG> <STRONG>*pad,</STRONG> <STRONG>chtype</STRONG> <STRONG>ch);</STRONG>
23 <H2>DESCRIPTION</H2><PRE>
24 The <STRONG>newpad</STRONG> routine creates and returns a pointer to a new
25 pad data structure with the given number of lines, <EM>nlines</EM>,
26 and columns, <EM>ncols</EM>. A pad is like a window, except that
27 it is not restricted by the screen size, and is not neces-
28 sarily associated with a particular part of the screen.
29 Pads can be used when a large window is needed, and only a
30 part of the window will be on the screen at one time.
31 Automatic refreshes of pads (<EM>e</EM>.<EM>g</EM>., from scrolling or echo-
32 ing of input) do not occur. It is not legal to call <STRONG>wre-</STRONG>
33 <STRONG>fresh</STRONG> with a <EM>pad</EM> as an argument; the routines <STRONG>prefresh</STRONG> or
34 <STRONG>pnoutrefresh</STRONG> should be called instead. Note that these
35 routines require additional parameters to specify the part
36 of the pad to be displayed and the location on the screen
37 to be used for the display.
39 The <STRONG>subpad</STRONG> routine creates and returns a pointer to a sub-
40 window within a pad with the given number of lines,
41 <EM>nlines</EM>, and columns, <EM>ncols</EM>. Unlike <STRONG>subwin</STRONG>, which uses
42 screen coordinates, the window is at position (<EM>begin</EM>_<EM>x</EM><STRONG>,</STRONG>
43 <EM>begin</EM>_<EM>y</EM>) on the pad. The window is made in the middle of
44 the window <EM>orig</EM>, so that changes made to one window affect
45 both windows. During the use of this routine, it will
46 often be necessary to call <STRONG>touchwin</STRONG> or <STRONG>touchline</STRONG> on <EM>orig</EM>
47 before calling <STRONG>prefresh</STRONG>.
49 The <STRONG>prefresh</STRONG> and <STRONG>pnoutrefresh</STRONG> routines are analogous to
50 <STRONG>wrefresh</STRONG> and <STRONG>wnoutrefresh</STRONG> except that they relate to pads
51 instead of windows. The additional parameters are needed
52 to indicate what part of the pad and screen are involved.
53 <EM>pminrow</EM> and <EM>pmincol</EM> specify the upper left-hand corner of
54 the rectangle to be displayed in the pad. <EM>sminrow</EM>, <EM>smin-</EM>
55 <EM>col</EM>, <EM>smaxrow</EM>, and <EM>smaxcol</EM> specify the edges of the rectan-
56 gle to be displayed on the screen. The lower right-hand
57 corner of the rectangle to be displayed in the pad is cal-
58 culated from the screen coordinates, since the rectangles
59 must be the same size. Both rectangles must be entirely
60 treated as if they were zero.
62 The <STRONG>pechochar</STRONG> routine is functionally equivalent to a call
63 to <STRONG>addch</STRONG> followed by a call to <STRONG>refresh</STRONG>, a call to <STRONG>waddch</STRONG>
64 followed by a call to <STRONG>wrefresh</STRONG>, or a call to <STRONG>waddch</STRONG> fol-
65 lowed by a call to <STRONG>prefresh.</STRONG> The knowledge that only a
66 single character is being output is taken into considera-
67 tion and, for non-control characters, a considerable per-
68 formance gain might be seen by using these routines
69 instead of their equivalents. In the case of <STRONG>pechochar</STRONG>,
70 the last location of the pad on the screen is reused for
71 the arguments to <STRONG>prefresh</STRONG>.
75 <H2>RETURN VALUE</H2><PRE>
76 Routines that return an integer return <STRONG>ERR</STRONG> upon failure
77 and <STRONG>OK</STRONG> (SVr4 only specifies "an integer value other than
78 <STRONG>ERR</STRONG>") upon successful completion.
80 Routines that return pointers return <STRONG>NULL</STRONG> on error, and
81 set <STRONG>errno</STRONG> to <STRONG>ENOMEM</STRONG>.
86 Note that <STRONG>pechochar</STRONG> may be a macro.
90 <H2>PORTABILITY</H2><PRE>
91 The XSI Curses standard, Issue 4 describes these func-
96 <H2>SEE ALSO</H2><PRE>
97 <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG>, <STRONG><A HREF="curs_refresh.3x.html">curs_refresh(3X)</A></STRONG>, <STRONG><A HREF="curs_touch.3x.html">curs_touch(3X)</A></STRONG>,
98 <STRONG><A HREF="curs_addch.3x.html">curs_addch(3X)</A></STRONG>.