]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/panel.3x
ncurses 6.2 - patch 20200212
[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.28 2020/02/02 23:34:34 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 .SH NAME
37 panel \- panel stack extension for curses
38 .SH SYNOPSIS
39 \fB#include <panel.h>\fR
40 .P
41 \fBcc [flags] sourcefiles \-lpanel \-lncurses\fR
42 .P
43 \fBPANEL *new_panel(WINDOW *win);\fR
44 .br
45 \fBint bottom_panel(PANEL *pan);\fR
46 .br
47 \fBint top_panel(PANEL *pan);\fR
48 .br
49 \fBint show_panel(PANEL *pan);\fR
50 .br
51 \fBvoid update_panels(void);\fR
52 .br
53 \fBint hide_panel(PANEL *pan);\fR
54 .br
55 \fBWINDOW *panel_window(const PANEL *pan);\fR
56 .br
57 \fBint replace_panel(PANEL *pan, WINDOW *window);\fR
58 .br
59 \fBint move_panel(PANEL *pan, int starty, int startx);\fR
60 .br
61 \fBint panel_hidden(const PANEL *pan);\fR
62 .br
63 \fBPANEL *panel_above(const PANEL *pan);\fR
64 .br
65 \fBPANEL *panel_below(const PANEL *pan);\fR
66 .br
67 \fBint set_panel_userptr(PANEL *pan, const void *ptr);\fR
68 .br
69 \fBconst void *panel_userptr(const PANEL *pan);\fR
70 .br
71 \fBint del_panel(PANEL *pan);\fR
72 .br
73 .SH DESCRIPTION
74 Panels are \fBcurses\fR(3X) windows with the added feature of
75 depth.
76 Panel functions allow the use of stacked windows and ensure
77 the proper portions of each window and the curses \fBstdscr\fR window are
78 hidden or displayed when panels are added, moved, modified or removed.
79 The set of currently visible panels is the stack of panels.
80 The
81 \fBstdscr\fR window is beneath all panels, and is not considered part
82 of the stack.
83 .P
84 A window is associated with every panel.
85 The panel routines enable
86 you to create, move, hide, and show panels, as well as position a
87 panel at any desired location in the stack.
88 .P
89 Panel routines are a functional layer added to \fBcurses\fR(3X), make only
90 high-level curses calls, and work anywhere terminfo curses does.
91 .SH FUNCTIONS
92 .TP
93 .B new_panel(win)
94 allocates  a  \fBPANEL\fR structure, associates it with
95 \fBwin\fR, places the panel on the top of the stack  (causes  it
96 to  be  displayed above any other panel) and returns a
97 pointer to the new panel.
98 .TP
99 .B update_panels
100 refreshes the \fIvirtual screen\fP to reflect the relations between the
101 panels in the stack, but does not call \fBdoupdate\fP to refresh the
102 \fIphysical screen\fP.
103 Use this function and not \fBwrefresh\fP or \fBwnoutrefresh\fP.
104 .B update_panels
105 may be called more than once before a call to
106 \fBdoupdate\fP, but \fBdoupdate\fP is the function responsible for updating
107 the \fIphysical screen\fP.
108 .TP
109 .B del_panel(pan)
110 removes the given panel from the  stack and deallocates the
111 \fBPANEL\fR structure (but not its associated window).
112 .TP
113 .B hide_panel(pan)
114 removes the given panel from the panel stack and thus hides it from
115 view.
116 The \fBPANEL\fR structure is not lost, merely removed from the stack.
117 .TP
118 .B panel_hidden(pan)
119 returns \fBTRUE\fP if the panel is in the panel stack,
120 \fBFALSE\fP if it is not.
121 If the panel is a null pointer, return \fBERR\fP.
122 .TP
123 .B show_panel(pan)
124 makes a hidden panel visible by placing it on top of the panels in the
125 panel stack.
126 See COMPATIBILITY below.
127 .TP
128 .B top_panel(pan)
129 puts the given visible panel on top of all panels in the stack.
130 See
131 COMPATIBILITY below.
132 .TP
133 .B bottom_panel(pan)
134 puts panel at the bottom of all panels.
135 .TP
136 .B move_panel(pan,starty,startx)
137 moves the given panel window so that its upper-left corner is at
138 \fBstarty\fR, \fBstartx\fR.
139 It does not change the position of the
140 panel in the stack.
141 Be sure to use this function, not \fBmvwin\fR,
142 to move a panel window.
143 .TP
144 .B replace_panel(pan,window)
145 replaces the current window of panel with \fBwindow\fR (useful, for
146 example if you want to resize a panel; if you're using \fBncurses\fR,
147 you can call \fBreplace_panel\fR on the output of \fBwresize\fR(3X)).
148 It does not change the position of the panel in the stack.
149 .TP
150 .B panel_above(pan)
151 returns a pointer to the panel above pan.
152 If the panel argument is
153 \fB(PANEL *)0\fR, it returns a pointer to the bottom panel in the stack.
154 .TP
155 .B panel_below(pan)
156 returns a pointer to the panel just below pan.
157 If the panel argument
158 is \fB(PANEL *)0\fR, it returns a pointer to the top panel in the stack.
159 .TP
160 .B set_panel_userptr(pan,ptr)
161 sets the panel's user pointer.
162 .TP
163 .B panel_userptr(pan)
164 returns the user pointer for a given panel.
165 .TP
166 .B panel_window(pan)
167 returns a pointer to the window of the given panel.
168 .SH DIAGNOSTICS
169 Each routine that returns a pointer returns \fBNULL\fR if an error
170 occurs.
171 Each routine that returns an int value returns \fBOK\fR if it
172 executes successfully and \fBERR\fR if not.
173 .SH COMPATIBILITY
174 Reasonable care has been taken to  ensure  compatibility
175 with  the  native  panel facility introduced in System V (inspection of
176 the SVr4 manual pages suggests the programming interface is unchanged).
177 The \fBPANEL\fR data structures are merely  similar.
178 The  programmer
179 is cautioned not to directly use \fBPANEL\fR fields.
180 .P
181 The functions \fBshow_panel\fR and \fBtop_panel\fR are identical
182 in this implementation, and work equally well with displayed or hidden
183 panels.
184 In the native System V implementation, \fBshow_panel\fR is
185 intended for making a hidden panel visible (at the top of the stack)
186 and \fBtop_panel\fR is intended for making an already-visible panel
187 move to the top of the stack.
188 You are cautioned to use the correct
189 function to ensure compatibility with native panel libraries.
190 .SH NOTE
191 In your library list, libpanel.a should be before libncurses.a; that is,
192 you should say \*(``\-lpanel \-lncurses\*('', not the other way around
193 (which would give a link-error with static libraries).
194 .SH PORTABILITY
195 .PP
196 The panel facility was documented in SVr4.2 in
197 \fICharacter User Interface Programming (UNIX SVR4.2)\fP.
198 .PP
199 It is not part of X/Open Curses.
200 .PP
201 Aside from ncurses, only systems based on SVr4 source code,
202 e.g., Solaris provide this library.
203 .SH FILES
204 .P
205 panel.h
206 interface for the panels library
207 .P
208 libpanel.a
209 the panels library itself
210 .SH SEE ALSO
211 \fBcurses\fR(3X),
212 \fBcurs_variables\fR(3X),
213 .PP
214 This describes \fBncurses\fR
215 version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
216 .SH AUTHOR
217 Originally written by Warren Tucker <wht@n4hgf.mt-park.ga.us>,
218 primarily to assist in porting u386mon to systems without a native
219 panels library.
220 Repackaged for ncurses by Zeyd ben-Halim.