1 .\" $Id: panel.3x,v 1.8 1997/12/14 01:49:25 tom Exp $
4 .ds d @DATADIR@/terminfo
6 panel - panel stack extension for curses
8 \fB#include <panel.h>\fR
10 \fBcc [flags] sourcefiles -lpanel -lncurses\fR
12 \fBPANEL *new_panel(WINDOW *win)\fR
14 \fBint bottom_panel(PANEL *pan)\fR
16 \fBint top_panel(PANEL *pan)\fR
18 \fBint show_panel(PANEL *pan)\fR
20 \fBvoid update_panels();\fR
22 \fBint hide_panel(PANEL *pan)\fR
24 \fBWINDOW *panel_window(const PANEL *pan)\fR
26 \fBint replace_panel(PANEL *pan, WINDOW *window)\fR
28 \fBint move_panel(PANEL *pan, int starty, int startx)\fR
30 \fBint panel_hidden(const PANEL *pan)\fR
32 \fBPANEL *panel_above(const PANEL *pan)\fR
34 \fBPANEL *panel_below(const PANEL *pan)\fR
36 \fBint set_panel_userptr(PANEL *pan, const void *ptr)\fR
38 \fBconst void *panel_userptr(const PANEL *pan)\fR
40 \fBint del_panel(PANEL *pan)\fR
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
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.
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.
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.
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
74 removes the given panel from the stack and deallocates the
75 \fBPANEL\fR structure (but not its associated window).
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.
82 makes a hidden panel visible by placing it on top of the panels in the
83 panel stack. See COMPATIBILITY below.
86 puts the given visible panel on top of all panels in the stack. See
89 \fBbottom_panel(pan)\fR
90 puts panel at the bottom of all panels.
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.
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.
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.
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.
112 \fBset_panel_userptr(pan,ptr)\fR
113 sets the panel's user pointer.
115 \fBpanel_userptr(pan)\fR
116 returns the user pointer for a given panel.
118 \fBpanel_window(pan)\fR
119 returns a pointer to the window of the given panel.
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.
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.
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.
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).
145 interface for the panels library
148 the panels library itself
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.