1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a *
5 .\" copy of this software and associated documentation files (the *
6 .\" "Software"), to deal in the Software without restriction, including *
7 .\" without limitation the rights to use, copy, modify, merge, publish, *
8 .\" distribute, distribute with modifications, sublicense, and/or sell *
9 .\" copies of the Software, and to permit persons to whom the Software is *
10 .\" furnished to do so, subject to the following conditions: *
12 .\" The above copyright notice and this permission notice shall be included *
13 .\" in all copies or substantial portions of the Software. *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 .\" Except as contained in this notice, the name(s) of the above copyright *
24 .\" holders shall not be used in advertising or otherwise to promote the *
25 .\" sale, use or other dealings in this Software without prior written *
27 .\"***************************************************************************
29 .\" $Id: curs_window.3x,v 1.10 2003/05/10 20:33:49 jmc Exp $
30 .\" $DragonFly: src/lib/libncurses/man/curs_window.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
43 \fBwsyncdown\fR - create \fBcurses\fR windows
45 \fB#include <curses.h>\fR
47 \fBWINDOW *newwin(int nlines, int ncols, int begin_y,\fR
50 \fBint delwin(WINDOW *win);\fR
52 \fBint mvwin(WINDOW *win, int y, int x);\fR
54 \fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols,\fR
55 \fBint begin_y, int begin_x);\fR
57 \fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols,\fR
58 \fBint begin_y, int begin_x);\fR
60 \fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR
62 \fBWINDOW *dupwin(WINDOW *win);\fR
64 \fBvoid wsyncup(WINDOW *win);\fR
66 \fBint syncok(WINDOW *win, bool bf);\fR
68 \fBvoid wcursyncup(WINDOW *win);\fR
70 \fBvoid wsyncdown(WINDOW *win);\fR
73 Calling \fBnewwin\fR creates and returns a pointer to a new window with the
74 given number of lines and columns. The upper left-hand corner of the window is
75 at line \fIbegin\fR_\fIy\fR, column \fIbegin\fR_\fIx\fR. If either
76 \fInlines\fR or \fIncols\fR is zero, they default to \fBLINES -\fR
77 \fIbegin\fR_\fIy\fR and \fBCOLS -\fR \fIbegin\fR_\fIx\fR. A new full-screen
78 window is created by calling \fBnewwin(0,0,0,0)\fR.
80 Calling \fBdelwin\fR deletes the named window, freeing all memory
81 associated with it (it does not actually erase the window's screen
82 image). Subwindows must be deleted before the main window can be
85 Calling \fBmvwin\fR moves the window so that the upper left-hand
86 corner is at position (\fIx\fR, \fIy\fR). If the move would cause the
87 window to be off the screen, it is an error and the window is not
88 moved. Moving subwindows is allowed, but should be avoided.
90 Calling \fBsubwin\fR creates and returns a pointer to a new window
91 with the given number of lines, \fInlines\fR, and columns,
92 \fIncols\fR. The window is at position (\fIbegin\fR_\fIy\fR,
93 \fIbegin\fR_\fIx\fR) on the screen. (This position is relative to the
94 screen, and not to the window \fIorig\fR.) The window is made in the
95 middle of the window \fIorig\fR, so that changes made to one window
96 will affect both windows. The subwindow shares memory with the window
97 \fIorig\fR. When using this routine, it is necessary to call
98 \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before calling
99 \fBwrefresh\fR on the subwindow.
101 Calling \fBderwin\fR is the same as calling \fBsubwin,\fR except that
102 \fIbegin\fR_\fIy\fR and \fIbegin\fR_\fIx\fR are relative to the origin
103 of the window \fIorig\fR rather than the screen. There is no
104 difference between the subwindows and the derived windows.
106 Calling \fBmvderwin\fR moves a derived window (or subwindow)
107 inside its parent window. The screen-relative parameters of the
108 window are not changed. This routine is used to display different
109 parts of the parent window at the same physical position on the
112 Calling \fBdupwin\fR creates an exact duplicate of the window \fIwin\fR.
114 Calling \fBwsyncup\fR touches all locations in ancestors of \fIwin\fR that are
115 changed in \fIwin\fR. If \fBsyncok\fR is called with second argument
116 \fBTRUE\fR then \fBwsyncup\fR is called automatically whenever there is a
117 change in the window.
119 The \fBwsyncdown\fR routine touches each location in \fIwin\fR that has been
120 touched in any of its ancestor windows. This routine is called by
121 \fBwrefresh\fR, so it should almost never be necessary to call it manually.
123 The routine \fBwcursyncup\fR updates the current cursor position of all the
124 ancestors of the window to reflect the current cursor position of the
127 Routines that return an integer return the integer \fBERR\fR upon failure and
128 \fBOK\fR (SVr4 only specifies "an integer value other than \fBERR\fR") upon
129 successful completion.
131 \fBdelwin\fR returns the integer \fBERR\fR upon failure and \fBOK\fR
132 upon successful completion.
134 Routines that return pointers return \fBNULL\fR on error.
136 If many small changes are made to the window, the \fBwsyncup\fR option could
139 Note that \fBsyncok\fR may be a macro.
141 The subwindow functions (\fIsubwin\fR, \fIderwin\fR, \fImvderwin\fR,
142 \fBwsyncup\fR, \fBwsyncdown\fR, \fBwcursyncup\fR, \fBsyncok\fR) are flaky,
143 incompletely implemented, and not well tested.
145 The System V curses documentation is very unclear about what \fBwsyncup\fR
146 and \fBwsyncdown\fR actually do. It seems to imply that they are only
147 supposed to touch exactly those lines that are affected by ancestor changes.
148 The language here, and the behavior of the \fBcurses\fR implementation,
149 is patterned on the XPG4 curses standard. The weaker XPG4 spec may result
152 The XSI Curses standard, Issue 4 describes these functions.
154 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X)
156 .\"# The following sets edit modes for GNU EMACS
157 .\"# Local Variables: