]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/panel.3x
ncurses 6.2 - patch 20200509
[ncurses.git] / man / panel.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
3 .\" Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: panel.3x,v 1.39 2020/02/15 21:06:40 tom Exp $
31 .TH panel 3X ""
32 .ie \n(.g .ds `` \(lq
33 .el       .ds `` ``
34 .ie \n(.g .ds '' \(rq
35 .el       .ds '' ''
36 .de bP
37 .ie n  .IP \(bu 4
38 .el    .IP \(bu 2
39 ..
40 .SH NAME
41 panel \- panel stack extension for curses
42 .SH SYNOPSIS
43 \fB#include <panel.h>\fR
44 .P
45 \fBcc [flags] sourcefiles \-lpanel \-lncurses\fR
46 .P
47 \fBPANEL *new_panel(WINDOW *\fIwin\fB);\fR
48 .sp
49 \fBint bottom_panel(PANEL *\fIpan\fB);\fR
50 .br
51 \fBint top_panel(PANEL *\fIpan\fB);\fR
52 .br
53 \fBint show_panel(PANEL *\fIpan\fB);\fR
54 .br
55 \fBvoid update_panels(void);\fR
56 .br
57 \fBint hide_panel(PANEL *\fIpan\fB);\fR
58 .sp
59 \fBWINDOW *panel_window(const PANEL *\fIpan\fB);\fR
60 .br
61 \fBint replace_panel(PANEL *\fIpan\fB, WINDOW *\fIwindow\fB);\fR
62 .br
63 \fBint move_panel(PANEL *\fIpan\fB, int \fIstarty\fB, int \fIstartx\fB);\fR
64 .br
65 \fBint panel_hidden(const PANEL *\fIpan\fB);\fR
66 .sp
67 \fBPANEL *panel_above(const PANEL *\fIpan\fB);\fR
68 .br
69 \fBPANEL *panel_below(const PANEL *\fIpan\fB);\fR
70 .sp
71 \fBint set_panel_userptr(PANEL *\fIpan\fB, const void *\fIptr\fB);\fR
72 .br
73 \fBconst void *panel_userptr(const PANEL *\fIpan\fB);\fR
74 .sp
75 \fBint del_panel(PANEL *\fIpan\fB);\fR
76 .sp
77 /* ncurses-extensions */
78 .br
79 \fBPANEL *ground_panel(SCREEN *\fIsp\fB);\fR
80 .br
81 \fBPANEL *ceiling_panel(SCREEN *\fIsp\fB);\fR
82 .br
83 .SH DESCRIPTION
84 Panels are \fBcurses\fR(3X) windows with the added feature of
85 depth.
86 Panel functions allow the use of stacked windows and ensure
87 the proper portions of each window and the curses \fBstdscr\fR window are
88 hidden or displayed when panels are added, moved, modified or removed.
89 The set of currently visible panels is the stack of panels.
90 The
91 \fBstdscr\fR window is beneath all panels, and is not considered part
92 of the stack.
93 .P
94 A window is associated with every panel.
95 The panel routines enable
96 you to create, move, hide, and show panels, as well as position a
97 panel at any desired location in the stack.
98 .P
99 Panel routines are a functional layer added to \fBcurses\fR(3X), make only
100 high-level curses calls, and work anywhere terminfo curses does.
101 .SH FUNCTIONS
102 .\" ---------
103 .SS bottom_panel
104 \fBbottom_panel(\fIpan\fB)\fR
105 puts panel \fIpan\fP at the bottom of all panels.
106 .\" ---------
107 .SS ceiling_panel
108 \fBceiling_panel(\fIsp\fB)\fR
109 acts like \fBpanel_below(NULL)\fP, for the given \fBSCREEN\fP \fIsp\fP.
110 .\" ---------
111 .SS del_panel
112 \fBdel_panel(\fIpan\fB)\fR
113 removes the given panel \fIpan\fP from the  stack and deallocates the
114 \fBPANEL\fR structure (but not its associated window).
115 .\" ---------
116 .SS ground_panel
117 \fBground_panel(\fIsp\fB)\fR
118 acts like \fBpanel_above(NULL)\fP, for the given \fBSCREEN\fP \fIsp\fP.
119 .\" ---------
120 .SS hide_panel
121 \fBhide_panel(\fIpan\fB)\fR
122 removes the given panel \fIpan\fP from the panel stack
123 and thus hides it from view.
124 The \fBPANEL\fR structure is not lost, merely removed from the stack.
125 .\" ---------
126 .SS move_panel
127 \fBmove_panel(\fIpan\fB,\fIstarty\fB,\fIstartx\fB)\fR
128 moves the given panel \fIpan\fP's window so that its upper-left corner is at
129 \fIstarty\fR, \fIstartx\fR.
130 It does not change the position of the panel in the stack.
131 Be sure to use this function, not \fBmvwin\fR(3X), to move a panel window.
132 .\" ---------
133 .SS new_panel
134 \fBnew_panel(\fIwin\fB)\fR allocates  a  \fBPANEL\fR structure,
135 associates it with \fIwin\fR, places the panel on the top of the stack
136 (causes  it to  be  displayed above any other panel) and returns a
137 pointer to the new panel.
138 .\" ---------
139 .SS panel_above
140 \fBpanel_above(\fIpan\fB)\fR
141 returns a pointer to the panel above \fIpan\fP.
142 If the panel argument is
143 \fB(PANEL *)0\fR, it returns a pointer to the bottom panel in the stack.
144 .\" ---------
145 .SS panel_below
146 \fBpanel_below(\fIpan\fB)\fR
147 returns a pointer to the panel just below \fIpan\fP.
148 If the panel argument
149 is \fB(PANEL *)0\fR, it returns a pointer to the top panel in the stack.
150 .\" ---------
151 .SS panel_hidden
152 \fBpanel_hidden(\fIpan\fB)\fR
153 returns \fBTRUE\fP if the panel \fIpan\fP is in the panel stack,
154 \fBFALSE\fP if it is not.
155 If the panel is a null pointer, return \fBERR\fP.
156 .\" ---------
157 .SS panel_userptr
158 \fBpanel_userptr(\fIpan\fB)\fR
159 returns the user pointer for a given panel \fIpan\fP.
160 .\" ---------
161 .SS panel_window
162 \fBpanel_window(\fIpan\fB)\fR
163 returns a pointer to the window of the given panel \fIpan\fP.
164 .\" ---------
165 .SS replace_panel
166 \fBreplace_panel(\fIpan\fB,\fIwindow\fB)\fR
167 replaces the current window of panel \fIpan\fP with \fIwindow\fR
168 This is useful, for example if you want to resize a panel.
169 In \fBncurses\fR, you can call \fBreplace_panel\fR
170 to resize a panel using a window resized with \fBwresize\fR(3X).
171 It does not change the position of the panel in the stack.
172 .\" ---------
173 .SS set_panel_userptr
174 \fBset_panel_userptr(\fIpan\fB,\fIptr\fB)\fR
175 sets the panel's user pointer.
176 .\" ---------
177 .SS show_panel
178 \fBshow_panel(\fIpan\fB)\fR
179 makes a hidden panel visible by placing it on top of the panels in the
180 panel stack.
181 See \fBCOMPATIBILITY\fP below.
182 .\" ---------
183 .SS top_panel
184 \fBtop_panel(\fIpan\fB)\fR
185 puts the given visible panel \fIpan\fP on top of all panels in the stack.
186 See \fBCOMPATIBILITY\fP below.
187 .\" ---------
188 .SS update_panels
189 \fBupdate_panels()\fR
190 refreshes the \fIvirtual screen\fP to reflect the relations between the
191 panels in the stack, but does not call \fBdoupdate\fP(3X) to refresh the
192 \fIphysical screen\fP.
193 Use this function and not \fBwrefresh\fP(3X) or \fBwnoutrefresh\fP(3X).
194 .PP
195 \fBupdate_panels\fP may be called more than once before a call to
196 \fBdoupdate\fP, but \fBdoupdate\fP is the function responsible for updating
197 the \fIphysical screen\fP.
198 .SH DIAGNOSTICS
199 Each routine that returns a pointer returns \fBNULL\fR if an error
200 occurs.
201 Each routine that returns an int value returns \fBOK\fR if it
202 executes successfully and \fBERR\fR if not.
203 .PP
204 Except as noted, the \fIpan\fP and \fIwindow\fP parameters must be non-null.
205 If those are null, an error is returned.
206 .PP
207 The \fBmove_panel\fP function uses \fBmvwin\fP(3X),
208 and will return an error if \fBmvwin\fP returns an error.
209 .SH COMPATIBILITY
210 Reasonable care has been taken to  ensure  compatibility
211 with  the  native  panel facility introduced in System V (inspection of
212 the SVr4 manual pages suggests the programming interface is unchanged).
213 The \fBPANEL\fR data structures are merely  similar.
214 The  programmer
215 is cautioned not to directly use \fBPANEL\fR fields.
216 .P
217 The functions \fBshow_panel\fR and \fBtop_panel\fR are identical
218 in this implementation, and work equally well with displayed or hidden
219 panels.
220 In the native System V implementation, \fBshow_panel\fR is
221 intended for making a hidden panel visible (at the top of the stack)
222 and \fBtop_panel\fR is intended for making an already-visible panel
223 move to the top of the stack.
224 You are cautioned to use the correct
225 function to ensure compatibility with native panel libraries.
226 .SH NOTE
227 In your library list, libpanel.a should be before libncurses.a; that is,
228 you should say \*(``\-lpanel \-lncurses\*('', not the other way around
229 (which would give a link-error with static libraries).
230 .SH PORTABILITY
231 .PP
232 The panel facility was documented in SVr4.2 in
233 \fICharacter User Interface Programming (UNIX SVR4.2)\fP.
234 .PP
235 It is not part of X/Open Curses.
236 .PP
237 A few implementations exist:
238 .bP
239 Systems based on SVr4 source code,
240 e.g., Solaris, provide this library.
241 .bP
242 \fBncurses\fP (since version 0.6 in 1993)
243 and \fBPDCurses\fP (since version 2.2 in 1995)
244 provide a panel library whose common ancestor
245 was a public domain implementation by Warren Tucker
246 published in \fIu386mon\fP 2.20 (1990).
247 .IP
248 According to Tucker, the SystemV panel library
249 was first released in SVr3.2 (1988),
250 and his implementation helped with a port to SVr3.1 (1987).
251 .IP
252 Several developers have improved each of these;
253 they are no longer the same as Tucker's implementation.
254 .bP
255 NetBSD 8 (2018)
256 has a panel library begun by Valery Ushakov in 2015.
257 This is based on the AT&T documentation.
258 .SH FILES
259 .P
260 panel.h
261 interface for the panels library
262 .P
263 libpanel.a
264 the panels library itself
265 .SH SEE ALSO
266 \fBcurses\fR(3X),
267 \fBcurs_variables\fR(3X),
268 .PP
269 This describes \fBncurses\fR
270 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
271 .SH AUTHOR
272 .PP
273 Originally written by Warren Tucker <wht@n4hgf.mt-park.ga.us>,
274 primarily to assist in porting \fIu386mon\fP to systems without a native
275 panels library.
276 .PP
277 Repackaged for ncurses by Zeyd ben-Halim.
278 .PP
279 Juergen Pfeifer and Thomas E. Dickey revised/improved the library.