Curses Library Functions curswindow(3CURSES)
NAME
curswindow, newwin, delwin, mvwin, subwin, derwin,
mvderwin, dupwin, wsyncup, syncok, wcursyncup, wsyncdown -
create curses windows
SYNOPSIS
cc [ flag ... ] file ... -lcurses [ library ... ]
#include
WINDOW *newwin(int nlines, int ncols, int beginy, int beginx);
int delwin(WINDOW *win);
int mvwin(WINDOW *win, int y, int x);
WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
int beginy, int beginx);
WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
int beginy, int beginx);
int mvderwin(WINDOW *win, int pary, int parx);
WINDOW *dupwin(WINDOW *win);
void wsyncup(WINDOW *win);
int syncok(WINDOW *win, bool bf);
void wcursyncup(WINDOW *win);
void wsyncdown(WINDOW *win);
DESCRIPTION
The newwin() routine creates and returns a pointer to a new
window with the given number of lines, nlines, and columns,
ncols. The upper left-hand corner of the window is at line
beginy, column beginx. If either nlines or ncols is zero,
they default to LINES - beginy and COLS - beginx. A new
full-screen window is created by calling newwin(0,0,0,0).
SunOS 5.11 Last change: 31 Dec 1996 1
Curses Library Functions curswindow(3CURSES)
The delwin() routine deletes the named window, freeing all
memory associated with it. Subwindows must be deleted before
the main window can be deleted.
The mvwin() routine moves the window so that the upper
left-hand corner is at position (x, y). If the move would
cause the window to be off the screen, it is an error and
the window is not moved. Moving subwindows is allowed, but
should be avoided.
The subwin() routine creates and returns a pointer to a new
window with the given number of lines, nlines, and columns,
ncols. The window is at position (beginy, beginx) on the
screen. (This position is relative to the screen, and not to
the window orig.) The window is made in the middle of the
window orig, so that changes made to one window will affect
both windows. The subwindow shares memory with the window
orig. When using this routine, it is necessary to call
touchwin() or touchline() on orig before calling wrefresh()
on the subwindow.
The derwin() routine is the same as subwin(), except that
beginy and beginx are relative to the origin of the window
orig rather than the screen. There is no difference between
the subwindows and the derived windows.
The mvderwin() routine moves a derived window (or subwindow)
inside its parent window. The screen-relative parameters of
the window are not changed. This routine is used to display
different parts of the parent window at the same physical
position on the screen.
The dupwin() routine creates an exact duplicate of the win-
dow win.
Each curses window maintains two data structures: the char-
acter image structure and the status structure. The charac-
ter image structure is shared among all windows in the win-
dow hierarchy (that is, the window with all subwindows). The
status structure, which contains information about indivi-
dual line changes in the window, is private to each window.
The routine wrefresh() uses the status data structure when
performing screen updating. Since status structures are not
shared, changes made to one window in the hierarchy may not
be properly reflected on the screen.
SunOS 5.11 Last change: 31 Dec 1996 2
Curses Library Functions curswindow(3CURSES)
The routine wsyncup() causes the changes in the status
structure of a window to be reflected in the status struc-
tures of its ancestors. If syncok() is called with second
argument TRUE then wsyncup() is called automatically when-
ever there is a change in the window.
The routine wcursyncup() updates the current cursor position
of all the ancestors of the window to reflect the current
cursor position of the window.
The routine wsyncdown() updates the status structure of the
window to reflect the changes in the status structures of
its ancestors. Applications seldom call this routine because
it is called automatically by wrefresh().
RETURN VALUES
Routines that return an integer return the integer ER upon
failure and an integer value other than ER upon successful
completion.
delwin() returns the integer ER upon failure and OK upon
successful completion.
Routines that return pointers return NUL on error.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
MT-Level Unsafe
SEE ALSO
cursrefresh(3CURSES), curstouch(3CURSES), curses(3CURSES),
attributes(5)
NOTES
The header automatically includes the headers
and .
SunOS 5.11 Last change: 31 Dec 1996 3
Curses Library Functions curswindow(3CURSES)
If many small changes are made to the window, the wsyncup()
option could degrade performance.
Note that syncok() may be a macro.
SunOS 5.11 Last change: 31 Dec 1996 4
|