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