X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=doc%2Fhtml%2Fman%2Fcurs_window.3x.html;h=b456816cf12588cd0aaa9a40f3b5a27dcf68a7ab;hb=75a9c36c205ebefe07580acd0b1053a2abbd44b9;hp=786ca4f93fe95c8e32df62d7a9471de7ce52fc8b;hpb=47d2fb4537d9ad5bb14f4810561a327930ca4280;p=ncurses.git diff --git a/doc/html/man/curs_window.3x.html b/doc/html/man/curs_window.3x.html index 786ca4f9..b456816c 100644 --- a/doc/html/man/curs_window.3x.html +++ b/doc/html/man/curs_window.3x.html @@ -1,6 +1,6 @@ -
--curs_window(3x) curs_window(3x) +curs_window(3x) Library calls curs_window(3x)
- newwin, delwin, mvwin, subwin, derwin, mvderwin, dupwin, wsyncup, - syncok, wcursyncup, wsyncdown - create curses windows + newwin, delwin, mvwin, subwin, derwin, mvderwin, dupwin, wsyncup, + syncok, wcursyncup, wsyncdown - create and manipulate curses windows
@@ -88,11 +88,19 @@ 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. +
Calling delwin deletes the named window, freeing all memory associated - with it (it does not actually erase the window's screen image). Sub- - windows must be deleted before the main window can be deleted. + with it (it does not actually erase the window's screen image). + Subwindows must be deleted before the main window can be deleted.
@@ -106,19 +114,22 @@ 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. The subwindow shares memory - with the window orig, so that changes made to one window will affect - both windows. When using this routine, it is necessary to call touch- - win or touchline on orig before calling wrefresh on the subwindow. + with the window orig, its ancestor, so that changes made to one window + will affect both windows. 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 + 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 par- - ent window. The screen-relative parameters of the window are not + +
+ 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. @@ -128,106 +139,124 @@
- 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 win- - dow. + 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 wsyncdown routine touches each location in win that has been + touched in any of its ancestor windows. This routine is called by + wrefresh, 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 + The routine wcursyncup updates the current cursor position of all the + ancestors of the window to reflect the current cursor position of the window.
Routines that return an integer return the integer ERR upon failure and - OK (SVr4 only specifies "an integer value other than ERR") upon suc- - cessful completion. + OK (SVr4 only specifies "an integer value other than ERR") upon + successful completion. 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 + 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 + 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, return- - ing an error if it was not.. + 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 + 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 + 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 + 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. - The functions which return a window pointer may also fail if there is - insufficient memory for its data structures. Any of these functions + The functions which return a window pointer may also fail if there is + insufficient memory for its data structures. Any of these functions will fail if the screen has not been initialized, i.e., with initscr or newterm.
- If many small changes are made to the window, the wsyncup option could + If many small changes are made to the window, the wsyncup option could degrade performance. Note that syncok may be a macro. -
- The subwindow functions (subwin, derwin, mvderwin, wsyncup, wsyncdown, - wcursyncup, syncok) are flaky, incompletely implemented, and not well - tested. +
+ The XSI Curses standard, Issue 4 describes these functions. - 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. + X/Open Curses states regarding delwin: + o It must delete subwindows before deleting their parent. -
- The XSI Curses standard, Issue 4 describes these functions. + o 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. + + o 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. + + o NetBSD copied this feature of ncurses in 2003. + PDCurses follows the scheme used in Solaris X/Open curses. + + +
+ The subwindow functions subwin, derwin, mvderwin, wsyncup, wsyncdown, + wcursyncup, and syncok are flaky, incompletely implemented, and not + well tested. + + 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.
- curses(3x), curs_refresh(3x), curs_touch(3x), curs_variables(3x) + curses(3x), curs_initscr(3x), curs_refresh(3x), curs_touch(3x), + curs_variables(3x) - curs_window(3x) +ncurses 6.4 2024-03-16 curs_window(3x)