1panel(3X) panel(3X)
2
3
4
6 panel - panel stack extension for curses
7
9 #include <panel.h>
10
11 cc [flags] sourcefiles -lpanel -lncurses
12
13 PANEL *new_panel(WINDOW *win);
14 int bottom_panel(PANEL *pan);
15 int top_panel(PANEL *pan);
16 int show_panel(PANEL *pan);
17 void update_panels(void);
18 int hide_panel(PANEL *pan);
19 WINDOW *panel_window(const PANEL *pan);
20 int replace_panel(PANEL *pan, WINDOW *window);
21 int move_panel(PANEL *pan, int starty, int startx);
22 int panel_hidden(const PANEL *pan);
23 PANEL *panel_above(const PANEL *pan);
24 PANEL *panel_below(const PANEL *pan);
25 int set_panel_userptr(PANEL *pan, const void *ptr);
26 const void *panel_userptr(const PANEL *pan);
27 int del_panel(PANEL *pan);
28
30 Panels are curses(3X) windows with the added feature of depth. Panel
31 functions allow the use of stacked windows and ensure the proper por‐
32 tions of each window and the curses stdscr window are hidden or dis‐
33 played when panels are added, moved, modified or removed. The set of
34 currently visible panels is the stack of panels. The stdscr window is
35 beneath all panels, and is not considered part of the stack.
36
37 A window is associated with every panel. The panel routines enable you
38 to create, move, hide, and show panels, as well as position a panel at
39 any desired location in the stack.
40
41 Panel routines are a functional layer added to curses(3X), make only
42 high-level curses calls, and work anywhere terminfo curses does.
43
45 new_panel(win)
46 allocates a PANEL structure, associates it with win, places
47 the panel on the top of the stack (causes it to be displayed
48 above any other panel) and returns a pointer to the new panel.
49
50 update_panels
51 refreshes the virtual screen to reflect the relations between
52 the panels in the stack, but does not call doupdate to refresh
53 the physical screen. Use this function and not wrefresh or
54 wnoutrefresh. update_panels may be called more than once before
55 a call to doupdate, but doupdate is the function responsible for
56 updating the physical screen.
57
58 del_panel(pan)
59 removes the given panel from the stack and deallocates the
60 PANEL structure (but not its associated window).
61
62 hide_panel(pan)
63 removes the given panel from the panel stack and thus hides it
64 from view. The PANEL structure is not lost, merely removed from
65 the stack.
66
67 panel_hidden(pan)
68 returns TRUE if the panel is in the panel stack, FALSE if it is
69 not. If the panel is a null pointer, return ERR.
70
71 show_panel(pan)
72 makes a hidden panel visible by placing it on top of the panels
73 in the panel stack. See COMPATIBILITY below.
74
75 top_panel(pan)
76 puts the given visible panel on top of all panels in the stack.
77 See COMPATIBILITY below.
78
79 bottom_panel(pan)
80 puts panel at the bottom of all panels.
81
82 move_panel(pan,starty,startx)
83 moves the given panel window so that its upper-left corner is at
84 starty, startx. It does not change the position of the panel in
85 the stack. Be sure to use this function, not mvwin, to move a
86 panel window.
87
88 replace_panel(pan,window)
89 replaces the current window of panel with window (useful, for
90 example if you want to resize a panel; if you're using ncurses,
91 you can call replace_panel on the output of wresize(3X)). It
92 does not change the position of the panel in the stack.
93
94 panel_above(pan)
95 returns a pointer to the panel above pan. If the panel argument
96 is (PANEL *)0, it returns a pointer to the bottom panel in the
97 stack.
98
99 panel_below(pan)
100 returns a pointer to the panel just below pan. If the panel
101 argument is (PANEL *)0, it returns a pointer to the top panel in
102 the stack.
103
104 set_panel_userptr(pan,ptr)
105 sets the panel's user pointer.
106
107 panel_userptr(pan)
108 returns the user pointer for a given panel.
109
110 panel_window(pan)
111 returns a pointer to the window of the given panel.
112
114 Each routine that returns a pointer returns NULL if an error occurs.
115 Each routine that returns an int value returns OK if it executes suc‐
116 cessfully and ERR if not.
117
119 Reasonable care has been taken to ensure compatibility with the
120 native panel facility introduced in System V (inspection of the SVr4
121 manual pages suggests the programming interface is unchanged). The
122 PANEL data structures are merely similar. The programmer is cau‐
123 tioned not to directly use PANEL fields.
124
125 The functions show_panel and top_panel are identical in this implemen‐
126 tation, and work equally well with displayed or hidden panels. In the
127 native System V implementation, show_panel is intended for making a
128 hidden panel visible (at the top of the stack) and top_panel is
129 intended for making an already-visible panel move to the top of the
130 stack. You are cautioned to use the correct function to ensure compat‐
131 ibility with native panel libraries.
132
134 In your library list, libpanel.a should be before libncurses.a; that
135 is, you should say “-lpanel -lncurses”, not the other way around (which
136 would give a link-error with static libraries).
137
139 The panel facility was documented in SVr4.2 in Character User Interface
140 Programming (UNIX SVR4.2).
141
142 It is not part of X/Open Curses.
143
144 Aside from ncurses, only systems based on SVr4 source code, e.g.,
145 Solaris provide this library.
146
148 panel.h interface for the panels library
149
150 libpanel.a the panels library itself
151
153 curses(3X), curs_variables(3X),
154
155 This describes ncurses version 6.1 (patch 20191109).
156
158 Originally written by Warren Tucker <wht@n4hgf.mt-park.ga.us>, primar‐
159 ily to assist in porting u386mon to systems without a native panels
160 library. Repackaged for ncurses by Zeyd ben-Halim.
161
162
163
164 panel(3X)