]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_window.3x
6aad4e7f49537dcf8734d405146917aa8b2edaf3
[ncurses.git] / man / curs_window.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 1998-2000,2003 Free Software Foundation, Inc.              *
3 .\"                                                                          *
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:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
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.                               *
22 .\"                                                                          *
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       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_window.3x,v 1.10 2003/05/10 20:33:49 jmc Exp $
30 .TH curs_window 3X ""
31 .SH NAME
32 \fBnewwin\fR,
33 \fBdelwin\fR,
34 \fBmvwin\fR,
35 \fBsubwin\fR,
36 \fBderwin\fR,
37 \fBmvderwin\fR,
38 \fBdupwin\fR,
39 \fBwsyncup\fR,
40 \fBsyncok\fR,
41 \fBwcursyncup\fR,
42 \fBwsyncdown\fR - create \fBcurses\fR windows
43 .SH SYNOPSIS
44 \fB#include <curses.h>\fR
45
46 \fBWINDOW *newwin(int nlines, int ncols, int begin_y,\fR
47       \fBint begin_x);\fR
48 .br
49 \fBint delwin(WINDOW *win);\fR
50 .br
51 \fBint mvwin(WINDOW *win, int y, int x);\fR
52 .br
53 \fBWINDOW *subwin(WINDOW *orig, int nlines, int ncols,\fR
54       \fBint begin_y, int begin_x);\fR
55 .br
56 \fBWINDOW *derwin(WINDOW *orig, int nlines, int ncols,\fR
57       \fBint begin_y, int begin_x);\fR
58 .br
59 \fBint mvderwin(WINDOW *win, int par_y, int par_x);\fR
60 .br
61 \fBWINDOW *dupwin(WINDOW *win);\fR
62 .br
63 \fBvoid wsyncup(WINDOW *win);\fR
64 .br
65 \fBint syncok(WINDOW *win, bool bf);\fR
66 .br
67 \fBvoid wcursyncup(WINDOW *win);\fR
68 .br
69 \fBvoid wsyncdown(WINDOW *win);\fR
70 .br
71 .SH DESCRIPTION
72 Calling \fBnewwin\fR creates and returns a pointer to a new window with the
73 given number of lines and columns.  The upper left-hand corner of the window is
74 at line \fIbegin\fR_\fIy\fR, column \fIbegin\fR_\fIx\fR.  If either
75 \fInlines\fR or \fIncols\fR is zero, they default to \fBLINES -\fR
76 \fIbegin\fR_\fIy\fR and \fBCOLS -\fR \fIbegin\fR_\fIx\fR.  A new full-screen
77 window is created by calling \fBnewwin(0,0,0,0)\fR.
78
79 Calling \fBdelwin\fR deletes the named window, freeing all memory
80 associated with it (it does not actually erase the window's screen
81 image).  Subwindows must be deleted before the main window can be
82 deleted.
83
84 Calling \fBmvwin\fR moves the window so that the upper left-hand
85 corner is at position (\fIx\fR, \fIy\fR).  If the move would cause the
86 window to be off the screen, it is an error and the window is not
87 moved.  Moving subwindows is allowed, but should be avoided.
88
89 Calling \fBsubwin\fR creates and returns a pointer to a new window
90 with the given number of lines, \fInlines\fR, and columns,
91 \fIncols\fR.  The window is at position (\fIbegin\fR_\fIy\fR,
92 \fIbegin\fR_\fIx\fR) on the screen.  (This position is relative to the
93 screen, and not to the window \fIorig\fR.)  The window is made in the
94 middle of the window \fIorig\fR, so that changes made to one window
95 will affect both windows.  The subwindow shares memory with the window
96 \fIorig\fR.  When using this routine, it is necessary to call
97 \fBtouchwin\fR or \fBtouchline\fR on \fIorig\fR before calling
98 \fBwrefresh\fR on the subwindow.
99
100 Calling \fBderwin\fR is the same as calling \fBsubwin,\fR except that
101 \fIbegin\fR_\fIy\fR and \fIbegin\fR_\fIx\fR are relative to the origin
102 of the window \fIorig\fR rather than the screen.  There is no
103 difference between the subwindows and the derived windows.
104
105 Calling \fBmvderwin\fR moves a derived window (or subwindow)
106 inside its parent window.  The screen-relative parameters of the
107 window are not changed.  This routine is used to display different
108 parts of the parent window at the same physical position on the
109 screen.
110
111 Calling \fBdupwin\fR creates an exact duplicate of the window \fIwin\fR.
112
113 Calling \fBwsyncup\fR touches all locations in ancestors of \fIwin\fR that are
114 changed in \fIwin\fR.  If \fBsyncok\fR is called with second argument
115 \fBTRUE\fR then \fBwsyncup\fR is called automatically whenever there is a
116 change in the window.
117
118 The \fBwsyncdown\fR routine touches each location in \fIwin\fR that has been
119 touched in any of its ancestor windows.  This routine is called by
120 \fBwrefresh\fR, so it should almost never be necessary to call it manually.
121
122 The routine \fBwcursyncup\fR updates the current cursor position of all the
123 ancestors of the window to reflect the current cursor position of the
124 window.
125 .SH RETURN VALUE
126 Routines that return an integer return the integer \fBERR\fR upon failure and
127 \fBOK\fR (SVr4 only specifies "an integer value other than \fBERR\fR") upon
128 successful completion.
129
130 \fBdelwin\fR returns the integer \fBERR\fR upon failure and \fBOK\fR
131 upon successful completion.
132
133 Routines that return pointers return \fBNULL\fR on error.
134 .SH NOTES
135 If many small changes are made to the window, the \fBwsyncup\fR option could
136 degrade performance.
137
138 Note that \fBsyncok\fR may be a macro.
139 .SH BUGS
140 The subwindow functions (\fIsubwin\fR, \fIderwin\fR, \fImvderwin\fR,
141 \fBwsyncup\fR, \fBwsyncdown\fR, \fBwcursyncup\fR, \fBsyncok\fR) are flaky,
142 incompletely implemented, and not well tested.
143
144 The System V curses documentation is very unclear about what \fBwsyncup\fR
145 and \fBwsyncdown\fR actually do.  It seems to imply that they are only
146 supposed to touch exactly those lines that are affected by ancestor changes.
147 The language here, and the behavior of the \fBcurses\fR implementation,
148 is patterned on the XPG4 curses standard.  The weaker XPG4 spec may result
149 in slower updates.
150 .SH PORTABILITY
151 The XSI Curses standard, Issue 4 describes these functions.
152 .SH SEE ALSO
153 \fBcurses\fR(3X), \fBcurs_refresh\fR(3X), \fBcurs_touch\fR(3X)
154 .\"#
155 .\"# The following sets edit modes for GNU EMACS
156 .\"# Local Variables:
157 .\"# mode:nroff
158 .\"# fill-column:79
159 .\"# End: