]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_pad.3x
ncurses 4.1
[ncurses.git] / man / curs_pad.3x
1 .TH curs_pad 3X ""
2 .SH NAME
3 \fBnewpad\fR, \fBsubpad\fR, \fBprefresh\fR,
4 \fBpnoutrefresh\fR, \fBpechochar\fR - create and display \fBcurses\fR
5 pads
6 .SH SYNOPSIS
7 \fB#include <curses.h>\fR
8
9 \fBWINDOW *newpad(int nlines, int ncols);\fR
10 .br
11 \fBWINDOW *subpad(WINDOW *orig, int nlines, int ncols,
12       int begin_y, int begin_x);\fR
13 .br
14 \fBint prefresh(WINDOW *pad, int pminrow, int pmincol,
15       int sminrow, int smincol, int smaxrow, int smaxcol);\fR
16 .br
17 \fBint pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
18       int sminrow, int smincol, int smaxrow, int smaxcol);\fR
19 .br
20 \fBint pechochar(WINDOW *pad, chtype ch);\fR
21 .SH DESCRIPTION
22 The \fBnewpad\fR routine creates and returns a pointer to a new pad data
23 structure with the given number of lines, \fInlines\fR, and columns,
24 \fIncols\fR.  A pad is like a window, except that it is not restricted by the
25 screen size, and is not necessarily associated with a particular part of the
26 screen.  Pads can be used when a large window is needed, and only a part of the
27 window will be on the screen at one time.  Automatic refreshes of pads
28 (\fIe\fR.\fIg\fR., from scrolling or echoing of input) do not occur.  It is not
29 legal to call \fBwrefresh\fR with a \fIpad\fR as an argument; the routines
30 \fBprefresh\fR or \fBpnoutrefresh\fR should be called instead.  Note that these
31 routines require additional parameters to specify the part of the pad to be
32 displayed and the location on the screen to be used for the display.
33
34 The \fBsubpad\fR routine creates and returns a pointer to a subwindow within a
35 pad with the given number of lines, \fInlines\fR, and columns, \fIncols\fR.
36 Unlike \fBsubwin\fR, which uses screen coordinates, the window is at position
37 (\fIbegin\fR_\fIx\fR\fB,\fR \fIbegin\fR_\fIy\fR) on the pad.  The window is
38 made in the middle of the window \fIorig\fR, so that changes made to one window
39 affect both windows.  During the use of this routine, it will often be
40 necessary to call \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before
41 calling \fBprefresh\fR.
42
43 The \fBprefresh\fR and \fBpnoutrefresh\fR routines are analogous to
44 \fBwrefresh\fR and \fBwnoutrefresh\fR except that they relate to pads instead
45 of windows.  The additional parameters are needed to indicate what part of the
46 pad and screen are involved.  \fIpminrow\fR and \fIpmincol\fR specify the upper
47 left-hand corner of the rectangle to be displayed in the pad.  \fIsminrow\fR,
48 \fIsmincol\fR, \fIsmaxrow\fR, and \fIsmaxcol\fR specify the edges of the
49 rectangle to be displayed on the screen.  The lower right-hand corner of the
50 rectangle to be displayed in the pad is calculated from the screen coordinates,
51 since the rectangles must be the same size.  Both rectangles must be entirely
52 contained within their respective structures.  Negative values of
53 \fIpminrow\fR, \fIpmincol\fR, \fIsminrow\fR, or \fIsmincol\fR are treated as if
54 they were zero.
55
56 The \fBpechochar\fR routine is functionally equivalent to a call to \fBaddch\fR
57 followed by a call to \fBrefresh\fR, a call to \fBwaddch\fR followed by a call
58 to \fBwrefresh\fR, or a call to \fBwaddch\fR followed by a call to
59 \fBprefresh.\fR The knowledge that only a single character is being output is
60 taken into consideration and, for non-control characters, a considerable
61 performance gain might be seen by using these routines instead of their
62 equivalents.  In the case of \fBpechochar\fR, the last location of the pad on
63 the screen is reused for the arguments to \fBprefresh\fR.
64 .SH RETURN VALUE
65 Routines that return an integer return \fBERR\fR upon failure and \fBOK\fR
66 (SVr4 only specifies "an integer value other than \fBERR\fR") upon successful
67 completion.
68
69 Routines that return pointers return \fBNULL\fR on error, and set \fBerrno\fR
70 to \fBENOMEM\fR.  
71 .SH NOTES
72 Note that \fBpechochar\fR may be a macro.
73 .SH PORTABILITY
74 The XSI Curses standard, Issue 4 describes these functions.
75 .SH SEE ALSO
76 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X), \fBcurs_addch\fR(3X).
77 .\"#
78 .\"# The following sets edit modes for GNU EMACS
79 .\"# Local Variables:
80 .\"# mode:nroff
81 .\"# fill-column:79
82 .\"# End: