HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)
n
newpad(3X) newpad(3X)
(CURSES)
NAME
newpad, pnoutrefresh, prefresh — pad management functions
SYNOPSIS
#include <curses.h>
WINDOW *newpad(int nlines, int ncols);
int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow,
int smincol, int smaxrow, int smaxcol);
int prefresh(WINDOW *pad, int pminrow, int pmincol, int sminrow,
int smincol, int smaxrow, int smaxcol);
DESCRIPTION
The newpad() function creates a specialised WINDOW
data structure representing a pad with nlines lines
and ncols columns. A pad is like a window, except that it is not necessarily associated with a viewable part
of the screen. Automatic refreshes of pads do not occur.
The
prefresh() and pnoutrefresh()
functions are analogous to wrefresh() and
wnoutrefresh() except that they relate to pads instead of windows. The additional arguments indi-
cate what part of the pad and screen are involved. The pminrow and pmincol arguments specify the origin
of the rectangle to be displayed in the pad. The sminrow, smincol, smaxrow and smaxcol arguments
specify the edges of the rectangle to be displayed on the screen. The lower right-hand corner of the rectan-
gle 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 pminrow, pmincol, sminrow or smincol are treated as if they were zero.
RETURN VALUE
Upon successful completion, the
newpad() function returns a pointer to the pad data structure. Other-
wise, it returns a null pointer.
Upon successful completion, pnoutrefresh()
and prefresh() return OK. Otherwise, they return
ERR.
ERRORS
No errors are defined.
APPLICATION USAGE
To refresh a pad, call
prefresh() or pnoutrefresh()
, not wrefresh() . When porting code to
use pads from WINDOWS, remember that these functions require additional arguments to specify the part
of the pad to be displayed and the location on the screen to be used for the display.
Although a subwindow and its parent pad may share memory representing characters in the pad, they need
not share status information about what has changed in the pad. Therefore, after modifying a subwindow
within a pad, it may be necessary to call
touchwin() or touchline() on the pad before calling
prefresh() .
SEE ALSO
derwin(3X), doupdate(3X), is_linetouched(3X), <curses.h>.
CHANGE HISTORY
First released in X/Open Curses, Issue 2.
X/Open Curses, Issue 4
The pnoutrefresh() and prefresh() functions are merged with this entry. In previous issues,
they appeared in the entry for prefresh() .
HP-UX 11i Version 3: February 2007 − 1 − Hewlett-Packard Company 75