derwin(3X) derwin(3X)
NAME
derwin, newwin, subwin - window creation functions
SYNOPSIS
cc [flag ...] file ... -lcurses [library ...]
#include <curses.h>
WINDOW *derwin(WINDOW *orig, int nlines, int ncols, int beginy,
int beginx);
WINDOW *newwin(int nlines, int ncols, int beginy, int beginx);
WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int beginy,
int beginx);
DESCRIPTION
The derwin() function is the same as subwin(), except that beginy and
beginx are relative to the origin of the window orig rather than
absolute screen positions.
The newwin() function creates a new window with nlines lines and ncols
columns, positioned so that the origin is (beginy, beginx). If
nlines is zero, it defaults to LINES - beginy; if ncols is zero, it
defaults to COLS - beginx.
The subwin() function creates a new window with nlines lines and ncols
columns, positioned so that the origin is at (beginy, beginx). (This
position is an absolute screen position, not a position relative to
the window orig.) If any part of the new window is outside orig, the
function fails and the window is not created.
RETURN VALUE
Upon successful completion, these functions return a pointer to the
new window. Otherwise, they return a null pointer.
ERRORS
No errors are defined.
NOTES
Before performing the first refresh of a subwindow, portable applica-
tions should call touchwin() or touchline() on the parent window.
Each window maintains internal descriptions of the screen image and
status. The screen image is shared among all windows in the window
hierarchy. Refresh operations rely on information on what has changed
within a window, which is private to each window. Refreshing a window,
when updates were made to a different window, may fail to perform
needed updates because the windows do not share this information.
Page 1 Reliant UNIX 5.44 Printed 11/98
derwin(3X) derwin(3X)
A new full-screen window is created by calling:
newwin(0, 0, 0, 0);
SEE ALSO
curses(3X), delwin(3X), doupdate(3X), islinetouched(3X), curses(5).
Page 2 Reliant UNIX 5.44 Printed 11/98