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