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