Main index | Section 3 | 日本語 | Options |
#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);
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).
Regardless of the function used for creating a new window (e.g., newwin, subwin, derwin, newpad), rather than a duplicate (with dupwin), all of the window modes are initialized to the default values. These functions set window modes after a window is created:
idcok idlok immedok keypad leaveok nodelay scrollok setscrreg syncok wbkgdset wbkgrndset and wtimeout.
Routines that return pointers return NULL on error.
X/Open defines no error conditions. In this implementation
delwin | |
returns an error if the window pointer is null, or if the window is the parent of another window. | |
derwin | |
returns an error if the parent window pointer is null, or if any of its ordinates or dimensions is negative, or if the resulting window does not fit inside the parent window. | |
dupwin | |
returns an error if the window pointer is null. | |
This implementation also maintains a list of windows, and checks that the pointer passed to delwin is one that it created, returning an error if it was not.. | |
mvderwin | |
returns an error if the window pointer is null, or if some part of the window would be placed off-screen. | |
mvwin | returns an error if the window pointer is null, or if the window is really a pad, or if some part of the window would be placed off-screen. |
newwin | |
will fail if either of its beginning ordinates is negative, or if either the number of lines or columns is negative. | |
syncok | |
returns an error if the window pointer is null. | |
subwin | |
returns an error if the parent window pointer is null, or if any of its ordinates or dimensions is negative, or if the resulting window does not fit inside the parent window. | |
Note that syncok may be a macro.
X/Open Curses states regarding delwin:
&#187; | It must delete subwindows before deleting their parent. |
&#187; | If delwin is asked to delete a parent window, it can only succeed if the curses library keeps a list of the subwindows. SVr4 curses kept a count of the number of subwindows rather than a list. It simply returned ERR when asked to delete a subwindow. Solaris X/Open curses does not even make that check, and will delete a parent window which still has subwindows. |
&#187; | Since release 4.0 (1996), ncurses maintains a list of windows for each screen, to ensure that a window has no subwindows before allowing deletion. |
&#187; |
NetBSD copied this feature of ncurses in 2003.
PDCurses follows the scheme used in Solaris X/Open curses. |
System V's curses documentation is unclear about what wsyncup and wsyncdown actually do. It seems to imply that they are supposed to touch only those lines that are affected by changes to a window's ancestors. The language here, and behavior of ncurses, is patterned on the X/Open Curses standard; this approach may result in slower updates.
2024-04-20 | curs_window (3X) | ncurses 6.5 |
Main index | Section 3 | 日本語 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | F U cn rd dis U mst uz Unix. | ” |