DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

curs_window(S-osr5)


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-osr5) 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-osr5) 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-osr5) 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-osr5) 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-osr5) or touchline(S-osr5) on orig before calling wrefresh(S-osr5) on the subwindow.

derwin

The The derwin(S-osr5) routine is the same as subwin(S-osr5) 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-osr5) 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-osr5) routine creates an exact duplicate of the window win.

Data structures

Each curses(S-osr5) 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-osr5) causes changes in the status structure of a window to be reflected in the status structures of its ancestors.

syncok

If syncok(S-osr5) is called with second argument TRUE then wsyncup( ) is called automatically whenever there is a change in the window.

wcursyncup

The routine wcursyncup(S-osr5) 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-osr5) 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-osr5), curs_refresh(S-osr5), curs_touch(S-osr5)

Standards conformance

newwin(S-osr5), delwin(S-osr5), mvwin(S-osr5), subwin(S-osr5), derwin(S-osr5), mvderwin(S-osr5), wsyncup(S-osr5), syncok(S-osr5), wcursyncup(S-osr5), wsyncdown(S-osr5), and dupwin(S-osr5) are not part of any currently supported standard; they were developed by UNIX System Laboratories, Inc. and are maintained by The SCO Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005