panel.3x.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2. <!--
  3. ****************************************************************************
  4. * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. *
  5. * *
  6. * Permission is hereby granted, free of charge, to any person obtaining a *
  7. * copy of this software and associated documentation files (the *
  8. * "Software"), to deal in the Software without restriction, including *
  9. * without limitation the rights to use, copy, modify, merge, publish, *
  10. * distribute, distribute with modifications, sublicense, and/or sell *
  11. * copies of the Software, and to permit persons to whom the Software is *
  12. * furnished to do so, subject to the following conditions: *
  13. * *
  14. * The above copyright notice and this permission notice shall be included *
  15. * in all copies or substantial portions of the Software. *
  16. * *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  20. * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  21. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  23. * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  24. * *
  25. * Except as contained in this notice, the name(s) of the above copyright *
  26. * holders shall not be used in advertising or otherwise to promote the *
  27. * sale, use or other dealings in this Software without prior written *
  28. * authorization. *
  29. ****************************************************************************
  30. * @Id: panel.3x,v 1.14 2007/05/12 20:45:20 tom Exp @
  31. -->
  32. <HTML>
  33. <HEAD>
  34. <TITLE>panel 3x</TITLE>
  35. <link rev=made href="mailto:bug-ncurses@gnu.org">
  36. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  37. </HEAD>
  38. <BODY>
  39. <H1>panel 3x</H1>
  40. <HR>
  41. <PRE>
  42. <!-- Manpage converted by man2html 3.0.1 -->
  43. <STRONG><A HREF="panel.3x.html">panel(3x)</A></STRONG> <STRONG><A HREF="panel.3x.html">panel(3x)</A></STRONG>
  44. </PRE>
  45. <H2>NAME</H2><PRE>
  46. panel - panel stack extension for curses
  47. </PRE>
  48. <H2>SYNOPSIS</H2><PRE>
  49. <STRONG>#include</STRONG> <STRONG>&lt;panel.h&gt;</STRONG>
  50. <STRONG>cc</STRONG> <STRONG>[flags]</STRONG> <STRONG>sourcefiles</STRONG> <STRONG>-lpanel</STRONG> <STRONG>-lncurses</STRONG>
  51. <STRONG>PANEL</STRONG> <STRONG>*new_panel(WINDOW</STRONG> <STRONG>*win)</STRONG>
  52. <STRONG>int</STRONG> <STRONG>bottom_panel(PANEL</STRONG> <STRONG>*pan)</STRONG>
  53. <STRONG>int</STRONG> <STRONG>top_panel(PANEL</STRONG> <STRONG>*pan)</STRONG>
  54. <STRONG>int</STRONG> <STRONG>show_panel(PANEL</STRONG> <STRONG>*pan)</STRONG>
  55. <STRONG>void</STRONG> <STRONG>update_panels();</STRONG>
  56. <STRONG>int</STRONG> <STRONG>hide_panel(PANEL</STRONG> <STRONG>*pan)</STRONG>
  57. <STRONG>WINDOW</STRONG> <STRONG>*panel_window(const</STRONG> <STRONG>PANEL</STRONG> <STRONG>*pan)</STRONG>
  58. <STRONG>int</STRONG> <STRONG>replace_panel(PANEL</STRONG> <STRONG>*pan,</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*window)</STRONG>
  59. <STRONG>int</STRONG> <STRONG>move_panel(PANEL</STRONG> <STRONG>*pan,</STRONG> <STRONG>int</STRONG> <STRONG>starty,</STRONG> <STRONG>int</STRONG> <STRONG>startx)</STRONG>
  60. <STRONG>int</STRONG> <STRONG>panel_hidden(const</STRONG> <STRONG>PANEL</STRONG> <STRONG>*pan)</STRONG>
  61. <STRONG>PANEL</STRONG> <STRONG>*panel_above(const</STRONG> <STRONG>PANEL</STRONG> <STRONG>*pan)</STRONG>
  62. <STRONG>PANEL</STRONG> <STRONG>*panel_below(const</STRONG> <STRONG>PANEL</STRONG> <STRONG>*pan)</STRONG>
  63. <STRONG>int</STRONG> <STRONG>set_panel_userptr(PANEL</STRONG> <STRONG>*pan,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*ptr)</STRONG>
  64. <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*panel_userptr(const</STRONG> <STRONG>PANEL</STRONG> <STRONG>*pan)</STRONG>
  65. <STRONG>int</STRONG> <STRONG>del_panel(PANEL</STRONG> <STRONG>*pan)</STRONG>
  66. </PRE>
  67. <H2>DESCRIPTION</H2><PRE>
  68. Panels are <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> windows with the added feature of
  69. depth. Panel functions allow the use of stacked windows
  70. and ensure the proper portions of each window and the
  71. curses <STRONG>stdscr</STRONG> window are hidden or displayed when panels
  72. are added, moved, modified or removed. The set of cur-
  73. rently visible panels is the stack of panels. The <STRONG>stdscr</STRONG>
  74. window is beneath all panels, and is not considered part
  75. of the stack.
  76. A window is associated with every panel. The panel rou-
  77. tines enable you to create, move, hide, and show panels,
  78. as well as position a panel at any desired location in the
  79. stack.
  80. Panel routines are a functional layer added to <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
  81. make only high-level curses calls, and work anywhere ter-
  82. minfo curses does.
  83. </PRE>
  84. <H2>FUNCTIONS</H2><PRE>
  85. <STRONG>new_panel(win)</STRONG>
  86. allocates a <STRONG>PANEL</STRONG> structure, associates it with
  87. <STRONG>win</STRONG>, places the panel on the top of the stack
  88. (causes it to be displayed above any other
  89. panel) and returns a pointer to the new panel.
  90. <STRONG>update_panels()</STRONG>
  91. refreshes the virtual screen to reflect the rela-
  92. tions between the panels in the stack, but does not
  93. call doupdate() to refresh the physical screen.
  94. Use this function and not wrefresh or wnoutrefresh.
  95. update_panels() may be called more than once before
  96. a call to doupdate(), but doupdate() is the func-
  97. tion responsible for updating the physical screen.
  98. <STRONG>del_panel(pan)</STRONG>
  99. removes the given panel from the stack and deallo-
  100. cates the <STRONG>PANEL</STRONG> structure (but not its associated
  101. window).
  102. <STRONG>hide_panel(pan)</STRONG>
  103. removes the given panel from the panel stack and
  104. thus hides it from view. The <STRONG>PANEL</STRONG> structure is not
  105. lost, merely removed from the stack.
  106. <STRONG>panel_hidden(pan)</STRONG>
  107. returns TRUE if the panel is in the panel stack,
  108. FALSE if it is not. If the panel is a null
  109. pointer, return ERR.
  110. <STRONG>show_panel(pan)</STRONG>
  111. makes a hidden panel visible by placing it on top
  112. of the panels in the panel stack. See COMPATIBILITY
  113. below.
  114. <STRONG>top_panel(pan)</STRONG>
  115. puts the given visible panel on top of all panels
  116. in the stack. See COMPATIBILITY below.
  117. <STRONG>bottom_panel(pan)</STRONG>
  118. puts panel at the bottom of all panels.
  119. <STRONG>move_panel(pan,starty,startx)</STRONG>
  120. moves the given panel window so that its upper-left
  121. corner is at <STRONG>starty</STRONG>, <STRONG>startx</STRONG>. It does not change
  122. the position of the panel in the stack. Be sure to
  123. use this function, not <STRONG>mvwin()</STRONG>, to move a panel
  124. window.
  125. <STRONG>replace_panel(pan,window)</STRONG>
  126. replaces the current window of panel with <STRONG>window</STRONG>
  127. (useful, for example if you want to resize a panel;
  128. if you're using <STRONG>ncurses</STRONG>, you can call <STRONG>replace_panel</STRONG>
  129. on the output of <STRONG><A HREF="wresize.3x.html">wresize(3x)</A></STRONG>). It does not change
  130. the position of the panel in the stack.
  131. <STRONG>panel_above(pan)</STRONG>
  132. returns a pointer to the panel above pan. If the
  133. panel argument is <STRONG>(PANEL</STRONG> <STRONG>*)0</STRONG>, it returns a pointer
  134. to the bottom panel in the stack.
  135. <STRONG>panel_below(pan)</STRONG>
  136. returns a pointer to the panel just below pan. If
  137. the panel argument is <STRONG>(PANEL</STRONG> <STRONG>*)0</STRONG>, it returns a
  138. pointer to the top panel in the stack.
  139. <STRONG>set_panel_userptr(pan,ptr)</STRONG>
  140. sets the panel's user pointer.
  141. <STRONG>panel_userptr(pan)</STRONG>
  142. returns the user pointer for a given panel.
  143. <STRONG>panel_window(pan)</STRONG>
  144. returns a pointer to the window of the given panel.
  145. </PRE>
  146. <H2>DIAGNOSTICS</H2><PRE>
  147. Each routine that returns a pointer returns <STRONG>NULL</STRONG> if an
  148. error occurs. Each routine that returns an int value
  149. returns <STRONG>OK</STRONG> if it executes successfully and <STRONG>ERR</STRONG> if not.
  150. </PRE>
  151. <H2>COMPATIBILITY</H2><PRE>
  152. Reasonable care has been taken to ensure compatibility
  153. with the native panel facility introduced in SVr3.2
  154. (inspection of the SVr4 manual pages suggests the
  155. programming interface is unchanged). The <STRONG>PANEL</STRONG> data
  156. structures are merely similar. The programmer is cau-
  157. tioned not to directly use <STRONG>PANEL</STRONG> fields.
  158. The functions <STRONG>show_panel()</STRONG> and <STRONG>top_panel()</STRONG> are identical
  159. in this implementation, and work equally well with dis-
  160. played or hidden panels. In the native System V implemen-
  161. tation, <STRONG>show_panel()</STRONG> is intended for making a hidden panel
  162. visible (at the top of the stack) and <STRONG>top_panel()</STRONG> is
  163. intended for making an already-visible panel move to the
  164. top of the stack. You are cautioned to use the correct
  165. function to ensure compatibility with native panel
  166. libraries.
  167. </PRE>
  168. <H2>NOTE</H2><PRE>
  169. In your library list, libpanel.a should be before libn-
  170. curses.a; that is, you want to say `-lpanel -lncurses',
  171. not the other way around (which would usually give a link-
  172. error).
  173. </PRE>
  174. <H2>FILES</H2><PRE>
  175. panel.h interface for the panels library
  176. libpanel.a the panels library itself
  177. </PRE>
  178. <H2>SEE ALSO</H2><PRE>
  179. <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
  180. This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
  181. </PRE>
  182. <H2>AUTHOR</H2><PRE>
  183. Originally written by Warren Tucker &lt;wht@n4hgf.mt-
  184. park.ga.us&gt;, primarily to assist in porting u386mon to
  185. systems without a native panels library. Repackaged for
  186. ncurses by Zeyd ben-Halim.
  187. <STRONG><A HREF="panel.3x.html">panel(3x)</A></STRONG>
  188. </PRE>
  189. <HR>
  190. <ADDRESS>
  191. Man(1) output converted with
  192. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  193. </ADDRESS>
  194. </BODY>
  195. </HTML>