curs_window(S)
curs_window: newwin, delwin, mvwin, subwin, derwin, mvderwin, dupwin, wsyncup, syncok, wcursyncup, wsyncdown --
create curses windows
Syntax
cc ... -lcurses
#include <curses.h>
WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x);
int delwin(WINDOW *win);
int mvwin(WINDOW *win, int y, int x);
WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y,
int begin_x);
WINDOW *derwin(WINDOW *orig, int nlines, int ncols, int begin_y,
int begin_x);
int mvderwin(WINDOW *win, int par_y, int par_x);
WINDOW *dupwin(WINDOW *win);
void wsyncup(WINDOW *win);
int syncok(WINDOW *win, bool bf);
void wcursyncup(WINDOW *win);
void wsyncdown(WINDOW *win);
Description
newwin
The
newwin(S)
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 begin_y,
column begin_x.
If either nlines or ncols is zero,
they default to LINES -- begin_y and COLS -- begin_x.
A new full-screen window is created by calling
newwin(0,0,0,0).
delwin
The
delwin(S)
routine
deletes the specified window, freeing all memory associated with it.
Subwindows must be deleted before the main window can be deleted.
mvwin
The
mvwin(S)
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.
subwin
The
subwin(S)
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 (begin_y, begin_x) 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 affect both windows.
The subwindow shares memory with the window orig.
When using this routine,
it is necessary to call
touchwin(S)
or
touchline(S)
on orig before calling
wrefresh(S)
on the subwindow.
derwin
The
The
derwin(S)
routine is the
same as
subwin(S)
except that begin_y and begin_x
are relative to the origin of the window orig rather than the
screen.
There is no difference between the subwindows and the derived windows.
mvderwin
The
mvderwin(S)
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.
dupwin
The
dupwin(S)
routine creates an exact duplicate of the
window win.
Data structures
Each
curses(S)
window maintains two data structures: the
character image structure and the status structure.
The character
image structure is shared among all windows in the window hierarchy
(that is, the window with all subwindows).
The status structure, which contains
information about individual line changes in the window, is private
to each window.
The routine
wrefresh( )
uses the status data structure when updating the screen.
Since status structures are not shared,
changes made to one window in the hierarchy may not be
properly reflected on the screen.
wsyncup
The routine
wsyncup(S)
causes changes in the status structure of a
window to be reflected in the status structures of its ancestors.
syncok
If
syncok(S)
is called with second argument TRUE
then
wsyncup( )
is called automatically whenever
there is a change in the window.
wcursyncup
The routine
wcursyncup(S)
updates the current cursor position of all the
ancestors of the window to reflect the current cursor position of the window.
wsyncdown
The routine
wsyncdown(S)
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 ERR on
failure and an integer value other than ERR
on successful completion.
delwin( )
returns the integer ERR on
failure and OK on successful completion.
Routines that return pointers return NULL on error.
Warning
The header file curses.h automatically includes the header files
stdio.h and unctrl.h.
If many small changes are made to the window, the
wsyncup( )
option could degrade performance.
syncok( )
can be a macro.
Files
/usr/lib/libcurses.a-
the library
See also
curses(S),
curs_refresh(S),
curs_touch(S)
Standards conformance
newwin(S),
delwin(S),
mvwin(S),
subwin(S),
derwin(S),
mvderwin(S),
wsyncup(S),
syncok(S),
wcursyncup(S),
wsyncdown(S),
and
dupwin(S)
are not part of any
currently supported standard;
they were developed by UNIX System Laboratories, Inc. and
are maintained by The SCO Group.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003