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