blob: cc36d22540828ab8fd8835d4770c8171ed1e3e74 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2020,2015 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: panel.3x,v 1.18 2015/04/11 10:23:49 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH panel 3X ""
31.ds n 5
32.ds d @TERMINFO@
33.SH NAME
Steve Kondikae271bc2015-11-15 02:50:53 +010034panel \- panel stack extension for curses
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053035.SH SYNOPSIS
36\fB#include <panel.h>\fR
37.P
Steve Kondikae271bc2015-11-15 02:50:53 +010038\fBcc [flags] sourcefiles \-lpanel \-lncurses\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053039.P
40\fBPANEL *new_panel(WINDOW *win)\fR
41.br
42\fBint bottom_panel(PANEL *pan)\fR
43.br
44\fBint top_panel(PANEL *pan)\fR
45.br
46\fBint show_panel(PANEL *pan)\fR
47.br
48\fBvoid update_panels();\fR
49.br
50\fBint hide_panel(PANEL *pan)\fR
51.br
52\fBWINDOW *panel_window(const PANEL *pan)\fR
53.br
54\fBint replace_panel(PANEL *pan, WINDOW *window)\fR
55.br
56\fBint move_panel(PANEL *pan, int starty, int startx)\fR
57.br
58\fBint panel_hidden(const PANEL *pan)\fR
59.br
60\fBPANEL *panel_above(const PANEL *pan)\fR
61.br
62\fBPANEL *panel_below(const PANEL *pan)\fR
63.br
64\fBint set_panel_userptr(PANEL *pan, const void *ptr)\fR
65.br
66\fBconst void *panel_userptr(const PANEL *pan)\fR
67.br
68\fBint del_panel(PANEL *pan)\fR
69.br
70.SH DESCRIPTION
71Panels are \fBcurses\fR(3X) windows with the added feature of
72depth. Panel functions allow the use of stacked windows and ensure
73the proper portions of each window and the curses \fBstdscr\fR window are
74hidden or displayed when panels are added, moved, modified or removed.
75The set of currently visible panels is the stack of panels. The
76\fBstdscr\fR window is beneath all panels, and is not considered part
77of the stack.
78.P
79A window is associated with every panel. The panel routines enable
80you to create, move, hide, and show panels, as well as position a
81panel at any desired location in the stack.
82.P
83Panel routines are a functional layer added to \fBcurses\fR(3X), make only
84high-level curses calls, and work anywhere terminfo curses does.
85.SH FUNCTIONS
86.TP
87.B new_panel(win)
88allocates a \fBPANEL\fR structure, associates it with
89\fBwin\fR, places the panel on the top of the stack (causes it
90to be displayed above any other panel) and returns a
91pointer to the new panel.
92.TP
93.B update_panels()
94refreshes the virtual screen to reflect the relations between the
95panels in the stack, but does not call doupdate() to refresh the
Steve Kondikae271bc2015-11-15 02:50:53 +010096physical screen.
97Use this function and not \fBwrefresh\fP or \fBwnoutrefresh\fP.
98.B update_panels
99may be called more than once before a call to
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530100doupdate(), but doupdate() is the function responsible for updating
101the physical screen.
102.TP
103.B del_panel(pan)
104removes the given panel from the stack and deallocates the
105\fBPANEL\fR structure (but not its associated window).
106.TP
107.B hide_panel(pan)
108removes the given panel from the panel stack and thus hides it from
109view. The \fBPANEL\fR structure is not lost, merely removed from the stack.
110.TP
111.B panel_hidden(pan)
Steve Kondikae271bc2015-11-15 02:50:53 +0100112returns \fBTRUE\fP if the panel is in the panel stack,
113\fBFALSE\fP if it is not.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530114If the panel is a null pointer, return ERR.
115.TP
116.B show_panel(pan)
117makes a hidden panel visible by placing it on top of the panels in the
118panel stack. See COMPATIBILITY below.
119.TP
120.B top_panel(pan)
121puts the given visible panel on top of all panels in the stack. See
122COMPATIBILITY below.
123.TP
124.B bottom_panel(pan)
125puts panel at the bottom of all panels.
126.TP
127.B move_panel(pan,starty,startx)
128moves the given panel window so that its upper-left corner is at
129\fBstarty\fR, \fBstartx\fR. It does not change the position of the
130panel in the stack. Be sure to use this function, not \fBmvwin()\fR,
131to move a panel window.
132.TP
133.B replace_panel(pan,window)
134replaces the current window of panel with \fBwindow\fR (useful, for
135example if you want to resize a panel; if you're using \fBncurses\fR,
136you can call \fBreplace_panel\fR on the output of \fBwresize\fR(3X)).
137It does not change the position of the panel in the stack.
138.TP
139.B panel_above(pan)
140returns a pointer to the panel above pan. If the panel argument is
141\fB(PANEL *)0\fR, it returns a pointer to the bottom panel in the stack.
142.TP
143.B panel_below(pan)
144returns a pointer to the panel just below pan. If the panel argument
145is \fB(PANEL *)0\fR, it returns a pointer to the top panel in the stack.
146.TP
147.B set_panel_userptr(pan,ptr)
148sets the panel's user pointer.
149.TP
150.B panel_userptr(pan)
151returns the user pointer for a given panel.
152.TP
153.B panel_window(pan)
154returns a pointer to the window of the given panel.
155.SH DIAGNOSTICS
156Each routine that returns a pointer returns \fBNULL\fR if an error
157occurs. Each routine that returns an int value returns \fBOK\fR if it
158executes successfully and \fBERR\fR if not.
159.SH COMPATIBILITY
160Reasonable care has been taken to ensure compatibility
161with the native panel facility introduced in SVr3.2 (inspection of
162the SVr4 manual pages suggests the programming interface is unchanged).
163The \fBPANEL\fR data structures are merely similar. The programmer
164is cautioned not to directly use \fBPANEL\fR fields.
165.P
166The functions \fBshow_panel()\fR and \fBtop_panel()\fR are identical
167in this implementation, and work equally well with displayed or hidden
168panels. In the native System V implementation, \fBshow_panel()\fR is
169intended for making a hidden panel visible (at the top of the stack)
170and \fBtop_panel()\fR is intended for making an already-visible panel
171move to the top of the stack. You are cautioned to use the correct
172function to ensure compatibility with native panel libraries.
173.SH NOTE
174In your library list, libpanel.a should be before libncurses.a; that is,
Steve Kondikae271bc2015-11-15 02:50:53 +0100175you want to say `\-lpanel \-lncurses', not the other way around (which would
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530176usually give a link-error).
177.SH FILES
178.P
179panel.h
180interface for the panels library
181.P
182libpanel.a
183the panels library itself
184.SH SEE ALSO
Steve Kondikae271bc2015-11-15 02:50:53 +0100185\fBcurses\fR(3X),
186\fBcurs_variables\fR(3X),
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530187.PP
188This describes \fBncurses\fR
189version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@).
190.SH AUTHOR
191Originally written by Warren Tucker <wht@n4hgf.mt-park.ga.us>,
192primarily to assist in porting u386mon to systems without a native
193panels library. Repackaged for ncurses by Zeyd ben-Halim.