source: trunk/ncurses/man/panel.3x@ 2787

Last change on this file since 2787 was 2621, checked in by bird, 19 years ago

GNU ncurses 5.5

File size: 7.6 KB
Line 
1.\"***************************************************************************
2.\" Copyright (c) 1998-2000,2003 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.11 2003/05/17 22:44:09 jmc Exp $
30.TH panel 3X ""
31.ds n 5
32.ds d @TERMINFO@
33.SH NAME
34panel - panel stack extension for curses
35.SH SYNOPSIS
36\fB#include <panel.h>\fR
37.P
38\fBcc [flags] sourcefiles -lpanel -lncurses\fR
39.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\fBnew_panel(win)\fR
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\fBvoid update_panels()\fR
94refreshes the virtual screen to reflect the relations between the
95panels in the stack, but does not call doupdate() to refresh the
96physical screen. Use this function and not wrefresh or wnoutrefresh.
97update_panels() may be called more than once before a call to
98doupdate(), but doupdate() is the function responsible for updating
99the physical screen.
100.TP
101\fBdel_panel(pan)\fR
102removes the given panel from the stack and deallocates the
103\fBPANEL\fR structure (but not its associated window).
104.TP
105\fBhide_panel(pan)\fR
106removes the given panel from the panel stack and thus hides it from
107view. The \fBPANEL\fR structure is not lost, merely removed from the stack.
108.TP
109\fBshow_panel(pan)\fR
110makes a hidden panel visible by placing it on top of the panels in the
111panel stack. See COMPATIBILITY below.
112.TP
113\fBtop_panel(pan)\fR
114puts the given visible panel on top of all panels in the stack. See
115COMPATIBILITY below.
116.TP
117\fBbottom_panel(pan)\fR
118puts panel at the bottom of all panels.
119.TP
120\fBmove_panel(pan,starty,startx)\fR
121moves the given panel window so that its upper-left corner is at
122\fBstarty\fR, \fBstartx\fR. It does not change the position of the
123panel in the stack. Be sure to use this function, not \fBmvwin()\fR,
124to move a panel window.
125.TP
126\fBreplace_panel(pan,window)\fR
127replaces the current window of panel with \fBwindow\fR (useful, for
128example if you want to resize a panel; if you're using \fBncurses\fR,
129you can call \fBreplace_panel\fR on the output of \fBwresize\fR(3X)).
130It does not change the position of the panel in the stack.
131.TP
132\fBpanel_above(pan)\fR
133returns a pointer to the panel above pan. If the panel argument is
134\fB(PANEL *)0\fR, it returns a pointer to the bottom panel in the stack.
135.TP
136\fBpanel_below(pan)\fR
137returns a pointer to the panel just below pan. If the panel argument
138is \fB(PANEL *)0\fR, it returns a pointer to the top panel in the stack.
139.TP
140\fBset_panel_userptr(pan,ptr)\fR
141sets the panel's user pointer.
142.TP
143\fBpanel_userptr(pan)\fR
144returns the user pointer for a given panel.
145.TP
146\fBpanel_window(pan)\fR
147returns a pointer to the window of the given panel.
148.SH DIAGNOSTICS
149Each routine that returns a pointer returns \fBNULL\fR if an error
150occurs. Each routine that returns an int value returns \fBOK\fR if it
151executes successfully and \fBERR\fR if not.
152.SH COMPATIBILITY
153Reasonable care has been taken to ensure compatibility
154with the native panel facility introduced in SVr3.2 (inspection of
155the SVr4 manual pages suggests the programming interface is unchanged).
156The \fBPANEL\fR data structures are merely similar. The programmer
157is cautioned not to directly use \fBPANEL\fR fields.
158.P
159The functions \fBshow_panel()\fR and \fBtop_panel()\fR are identical
160in this implementation, and work equally well with displayed or hidden
161panels. In the native System V implementation, \fBshow_panel()\fR is
162intended for making a hidden panel visible (at the top of the stack)
163and \fBtop_panel()\fR is intended for making an already-visible panel
164move to the top of the stack. You are cautioned to use the correct
165function to ensure compatibility with native panel libraries.
166.SH NOTE
167In your library list, libpanel.a should be before libncurses.a; that is,
168you want to say `-lpanel -lncurses', not the other way around (which would
169give you a link error using GNU \fBld\fR(1) and some other linkers).
170.SH FILES
171.P
172panel.h
173interface for the panels library
174.P
175libpanel.a
176the panels library itself
177.SH SEE ALSO
178\fBcurses\fR(3X)
179.SH AUTHOR
180Originally written by Warren Tucker <wht@n4hgf.mt-park.ga.us>,
181primarily to assist in porting u386mon to systems without a native
182panels library. Repackaged for ncurses by Zeyd ben-Halim.
Note: See TracBrowser for help on using the repository browser.