Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

derwin(3xcurses) [sunos man page]

derwin(3XCURSES)					  X/Open Curses Library Functions					  derwin(3XCURSES)

NAME
derwin, newwin, subwin - create a new window or subwindow SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> WINDOW *derwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x); WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x); WINDOW *subwin(WINDOW *orig, int nlines, int ncols, int begin_y, int begin_x); DESCRIPTION
The derwin() function creates a subwindow within window orig, with the specified number of lines and columns, and upper left corner posi- tioned at begin_x, begin_y relative to window orig. A pointer to the new window structure is returned. The newwin() function creates a new window with the specified number of lines and columns and upper left corner positioned at begin_x, begin_y. A pointer to the new window structure is returned. A full-screen window can be created by calling newwin(0,0,0,0). If the number of lines specified is zero, newwin() uses a default value of LINES minus begin_y; if the number of columns specified is zero, newwin() uses the default value of COLS minus begin_x. The subwin() function creates a subwindow within window orig, with the specified number of lines and columns, and upper left corner posi- tioned at begin_x, begin_y (relative to the physical screen, not to window orig). A pointer to the new window structure is returned. The original window and subwindow share character storage of the overlapping area (each window maintains its own pointers, cursor location, and other items). This means that characters and attributes are identical in overlapping areas regardless of which window characters are written to. When using subwindows, it is often necessary to call touchwin(3XCURSES) before wrefresh(3XCURSES) to maintain proper screen contents. PARAMETERS
orig Is a pointer to the parent window for the newly created subwindow. nlines Is the number of lines in the subwindow. ncols Is the number of columns in the subwindow. begin_y Is the y (row) coordinate of the upper left corner of the subwindow, relative to the parent window. begin_x Is the x (column) coordinate of the upper left corner of the subwindow, relative to the parent window. RETURN VALUES
On success, these functions return a pointer to the newly-created window. Otherwise, they return ERR. ERRORS
None. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
doupdate(3XCURSES), is_linetouched(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 derwin(3XCURSES)

Check Out this Related Man Page

curs_window(3X) 														   curs_window(3X)

NAME
newwin, delwin, mvwin, subwin, derwin, mvderwin, dupwin, wsyncup, syncok, wcursyncup, wsyncdown - create curses windows SYNOPSIS
#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
Calling newwin creates and returns a pointer to a new window with the given number of lines and columns. 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). Calling delwin deletes the named window, freeing all memory associated with it (it does not actually erase the window's screen image). Subwindows must be deleted before the main window can be deleted. Calling mvwin 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. Calling subwin 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 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. Calling derwin is the same as calling subwin, 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. Calling mvderwin 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. Calling dupwin creates an exact duplicate of the window win. Calling wsyncup touches all locations in ancestors of win that are changed in win. If syncok is called with second argument TRUE then wsyncup is called automatically whenever there is a change in the window. The wsyncdown routine touches each location in win that has been touched in any of its ancestor windows. This routine is called by wre- fresh, so it should almost never be necessary to call it manually. The routine wcursyncup updates the current cursor position of all the ancestors of the window to reflect the current cursor position of the window. RETURN VALUE
Routines that return an integer return the integer ERR upon failure and OK (SVr4 only specifies "an integer value other than ERR") upon successful completion. delwin returns the integer ERR upon failure and OK upon successful completion. Routines that return pointers return NULL on error. NOTES
If many small changes are made to the window, the wsyncup option could degrade performance. Note that syncok may be a macro. BUGS
The subwindow functions (subwin, derwin, mvderwin, wsyncup, wsyncdown, wcursyncup, syncok) are flaky, incompletely implemented, and not well tested. The System V curses documentation is very unclear about what wsyncup and wsyncdown actually do. It seems to imply that they are only sup- posed to touch exactly those lines that are affected by ancestor changes. The language here, and the behavior of the curses implementa- tion, is patterned on the XPG4 curses standard. The weaker XPG4 spec may result in slower updates. PORTABILITY
The XSI Curses standard, Issue 4 describes these functions. SEE ALSO
curses(3X), curs_refresh(3X), curs_touch(3X) curs_window(3X)
Man Page