DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

newpad(CURSES)


<xref type="10" name="newpad"></xref> newpad -- pad management functions

Synopsis

cc [options] file -lcurses
#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);

Description

The newpad(CURSES) 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 subpad(CURSES) function creates a subwindow within a pad with nlines lines and ncols columns. Unlike subwin(CURSES), 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(CURSES) and pnoutrefresh(CURSES) functions are analogous to wrefresh(CURSES) and wnoutrefresh(CURSES) 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.

Return value

Upon successful completion, the newpad(CURSES) and subpad(CURSES) functions return a pointer to the pa data structure. Otherwise, they return a null pointer.

Upon successful completion, pnoutrefresh(CURSES) and prefresh(CURSES) return OK. Otherwise, they return ERR.

Errors

No errors are defined.

Usage

To refresh a pad, call prefresh(CURSES) or pnoutrefresh(CURSES), not wrefresh(CURSES). 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(CURSES) or touchline(CURSES) on the pad before calling prefresh(CURSES).

Standards Conformance

The Single UNIX Specification, Version 2; The Open Group.

References

derwin(CURSES), doupdate(CURSES), is_linetouched(CURSES), curses(F)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005