#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);
WINDOW *subpad(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x);
The subpad(3curses) function creates a subwindow within a pad with nlines lines and ncols columns. Unlike subwin(3curses), which uses screen coordinates, the window is at position (begin_y, begin_x) on the pad. The window is made in the middle of the window orig, so that changes made to one window affect both windows.
The prefresh(3curses) and pnoutrefresh(3curses) functions are analogous to wrefresh(3curses) and wnoutrefresh(3curses) except that they relate to pads instead of windows. The additional arguments indicate 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 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 pminrow, pmincol, sminrow or smincol are treated as if they were zero.
Upon successful completion, pnoutrefresh(3curses) and prefresh(3curses) return OK. Otherwise, they return ERR.
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(3curses) or touchline(3curses) on the pad before calling prefresh(3curses).