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