'\"macro stdmacro
.if n .pH g3x.curs_pad @(#)curs_pad	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/curs_pad	1.4"
.nr X
.if \nX=0 .ds x} curs_pad 3X "" "\&"
.if \nX=1 .ds x} curs_pad 3X ""
.if \nX=2 .ds x} curs_pad 3X "" "\&"
.if \nX=3 .ds x} curs_pad "" "" "\&"
.TH \*(x}
.SH NAME
\f4curs_pad\f2: \f4 newpad\f1, \f4subpad\f1, \f4prefresh\f1, \f4pnoutrefresh\f1, \f4pechochar\f1 \- create and display \f4curses\fP pads
.SH SYNOPSIS
.nf
.ft 4
#include <curses.h>
.sp
WINDOW *newpad(int nlines, int ncols);
.sp .5
WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
	int begin_y, int begin_x);
.sp 0.5
int prefresh(WINDOW *pad, int pminrow, int pmincol,
	int sminrow, int smincol, int smaxrow, int smaxcol);
.sp 0.5
int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
	int sminrow, int smincol, int smaxrow, int smaxcol);
.sp .5
int pechochar(WINDOW *pad, chtype ch);
.ft 1
.fi
.SH DESCRIPTION
The \f4newpad\f1 routine creates and returns a pointer to a new
pad data structure with the given number of lines,
\f2nlines\f1,
and columns,
\f2ncols\f1.
A pad is like a window,
except that it is not restricted by the screen size,
and is not necessarily associated with a particular part of the screen.
Pads can be used when a large window is needed, and only a part of the window
will be on the screen at one time.
Automatic refreshes of pads (\f2e.g.\f1,
from scrolling or echoing of input) do not occur.
It is not legal to call \f4wrefresh\f1
with a \f2pad\f1 as an argument; the routines \f4prefresh\f1
or \f4pnoutrefresh\f1 should be called instead.
Note that these routines require additional parameters to specify the part of
the pad to be displayed and the location on the screen to
be used for the display.
.P
The \f4subpad\f1 routine creates and returns a pointer to a subwindow 
within a pad with the given number of lines,
\f2nlines\f1, and columns, \f2ncols\f1.
Unlike \f4subwin\f1, which uses screen coordinates,
the window is at position (\f2begin_x\f4, \f2begin_y\f1) on the pad.
The window is made in the middle of the window
\f2orig\f1,
so that changes made to one window affect both windows.
During the use of this routine, it will often be necessary to call
\f4touchwin\f1 or \f4touchline\f1
on \f2orig\f1 before calling \f4prefresh\f1.
.P
The \f4prefresh\f1 and \f4pnoutrefresh\f1 routines are analogous to
\f4wrefresh\f1 and \f4wnoutrefresh\f1
except that they relate to pads instead of windows.
The additional parameters are needed to indicate what part of the pad and
screen are involved.
\f2pminrow\f1
and
\f2pmincol\f1
specify the upper left-hand corner of the rectangle to be displayed in the pad.
\f2sminrow\f1,
\f2smincol\f1,
\f2smaxrow\f1,
and
\f2smaxcol\f1
specify the edges of the rectangle to be displayed on the screen.
The lower right-hand corner of the rectangle to be
displayed in the pad is calculated from the screen coordinates, since the
rectangles must be the same size.
Both rectangles must be entirely contained
within their respective structures.
Negative values of \f2pminrow\f1,
\f2pmincol\f1, \f2sminrow\f1, or \f2smincol\f1
are treated as if they were zero.
.P
The \f4pechochar\f1 routine is functionally equivalent to a call to
\f4addch\fP
followed by a call to
\f4refresh\f1,
a call to
\f4waddch\f1
followed by a call to
\f4wrefresh\f1,
or a call to
\f4waddch\f1
followed by a call to
\f4prefresh.\f1
The knowledge that only a single character is
being output is taken into consideration and,
for non-control characters, a considerable performance
gain might be seen by using these routines instead of their equivalents.
In the case of \f4pechochar\f1,
the last location of the pad on the screen is reused for the
arguments to \f4prefresh\f1.
.SH RETURN VALUE
Routines that return an integer return \f4ERR\f1 upon
failure and an integer value other than \f4ERR\f1
upon successful completion.
.P
Routines that return pointers return \f4NULL\f1 on error.
.SH NOTES
.P
The header file \f4<curses.h>\f1 automatically includes the header files
\f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
Note that \f4pechochar\fP may be a macro.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4curs_refresh\fP(3X),
\f4curs_touch\fP(3X),
\f4curs_addch\fP(3X).
.ad
