menu.3x.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  2. <!--
  3. * t
  4. ****************************************************************************
  5. * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. *
  6. * *
  7. * Permission is hereby granted, free of charge, to any person obtaining a *
  8. * copy of this software and associated documentation files (the *
  9. * "Software"), to deal in the Software without restriction, including *
  10. * without limitation the rights to use, copy, modify, merge, publish, *
  11. * distribute, distribute with modifications, sublicense, and/or sell *
  12. * copies of the Software, and to permit persons to whom the Software is *
  13. * furnished to do so, subject to the following conditions: *
  14. * *
  15. * The above copyright notice and this permission notice shall be included *
  16. * in all copies or substantial portions of the Software. *
  17. * *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
  19. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
  20. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
  21. * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
  22. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
  23. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
  24. * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
  25. * *
  26. * Except as contained in this notice, the name(s) of the above copyright *
  27. * holders shall not be used in advertising or otherwise to promote the *
  28. * sale, use or other dealings in this Software without prior written *
  29. * authorization. *
  30. ****************************************************************************
  31. * @Id: menu.3x,v 1.19 2006/11/04 18:38:29 tom Exp @
  32. -->
  33. <HTML>
  34. <HEAD>
  35. <TITLE>menu 3x</TITLE>
  36. <link rev=made href="mailto:bug-ncurses@gnu.org">
  37. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  38. </HEAD>
  39. <BODY>
  40. <H1>menu 3x</H1>
  41. <HR>
  42. <PRE>
  43. <!-- Manpage converted by man2html 3.0.1 -->
  44. <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>
  45. </PRE>
  46. <H2>NAME</H2><PRE>
  47. <STRONG>menu</STRONG> - curses extension for programming menus
  48. </PRE>
  49. <H2>SYNOPSIS</H2><PRE>
  50. <STRONG>#include</STRONG> <STRONG>&lt;menu.h&gt;</STRONG>
  51. </PRE>
  52. <H2>DESCRIPTION</H2><PRE>
  53. The <STRONG>menu</STRONG> library provides terminal-independent facilities
  54. for composing menu systems on character-cell terminals.
  55. The library includes: item routines, which create and mod-
  56. ify menu items; and menu routines, which group items into
  57. menus, display menus on the screen, and handle interaction
  58. with the user.
  59. The <STRONG>menu</STRONG> library uses the <STRONG>curses</STRONG> libraries, and a curses
  60. initialization routine such as <STRONG>initscr</STRONG> must be called
  61. before using any of these functions. To use the <STRONG>menu</STRONG>
  62. library, link with the options <STRONG>-lmenu</STRONG> <STRONG>-lcurses</STRONG>.
  63. <STRONG>Current</STRONG> <STRONG>Default</STRONG> <STRONG>Values</STRONG> <STRONG>for</STRONG> <STRONG>Item</STRONG> <STRONG>Attributes</STRONG>
  64. The <STRONG>menu</STRONG> library maintains a default value for item
  65. attributes. You can get or set this default by calling
  66. the appropriate <STRONG>get_</STRONG> or <STRONG>set_</STRONG> routine with a <STRONG>NULL</STRONG> item
  67. pointer. Changing this default with a <STRONG>set_</STRONG> function
  68. affects future item creations, but does not change the
  69. rendering of items already created.
  70. <STRONG>Routine</STRONG> <STRONG>Name</STRONG> <STRONG>Index</STRONG>
  71. The following table lists each <STRONG>menu</STRONG> routine and the name
  72. of the manual page on which it is described.
  73. <STRONG>curses</STRONG> Routine Name Manual Page Name
  74. --------------------------------------------
  75. current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG>
  76. free_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3x)</A></STRONG>
  77. free_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3x)</A></STRONG>
  78. item_count <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG>
  79. item_description <STRONG><A HREF="mitem_name.3x.html">mitem_name(3x)</A></STRONG>
  80. item_index <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG>
  81. item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  82. item_name <STRONG><A HREF="mitem_name.3x.html">mitem_name(3x)</A></STRONG>
  83. item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG>
  84. item_opts_off <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG>
  85. item_opts_on <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG>
  86. item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  87. item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></STRONG>
  88. item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3x)</A></STRONG>
  89. item_visible <STRONG><A HREF="mitem_visible.3x.html">mitem_visible(3x)</A></STRONG>
  90. menu_back <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  91. menu_driver <STRONG><A HREF="menu_driver.3x.html">menu_driver(3x)</A></STRONG>
  92. menu_fore <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  93. menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3x)</A></STRONG>
  94. menu_grey <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  95. menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  96. menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG>
  97. menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3x)</A></STRONG>
  98. menu_opts <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG>
  99. menu_opts_off <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG>
  100. menu_opts_on <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG>
  101. menu_pad <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  102. menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></STRONG>
  103. menu_request_by_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></STRONG>
  104. menu_request_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></STRONG>
  105. menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></STRONG>
  106. menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG>
  107. menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  108. menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></STRONG>
  109. menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG>
  110. new_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3x)</A></STRONG>
  111. new_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3x)</A></STRONG>
  112. pos_menu_cursor <STRONG><A HREF="menu_cursor.3x.html">menu_cursor(3x)</A></STRONG>
  113. post_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3x)</A></STRONG>
  114. scale_menu <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG>
  115. set_current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG>
  116. set_item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  117. set_item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG>
  118. set_item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  119. set_item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></STRONG>
  120. set_item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3x)</A></STRONG>
  121. set_menu_back <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  122. set_menu_fore <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  123. set_menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3x)</A></STRONG>
  124. set_menu_grey <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  125. set_menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  126. set_menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG>
  127. set_menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3x)</A></STRONG>
  128. set_menu_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG>
  129. set_menu_pad <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG>
  130. set_menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></STRONG>
  131. set_menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></STRONG>
  132. set_menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG>
  133. set_menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG>
  134. set_menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></STRONG>
  135. set_menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG>
  136. set_top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG>
  137. top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG>
  138. unpost_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3x)</A></STRONG>
  139. </PRE>
  140. <H2>RETURN VALUE</H2><PRE>
  141. Routines that return pointers return <STRONG>NULL</STRONG> on error. Rou-
  142. tines that return an integer return one of the following
  143. error codes:
  144. <STRONG>E_OK</STRONG> The routine succeeded.
  145. <STRONG>E_BAD_ARGUMENT</STRONG>
  146. Routine detected an incorrect or out-of-range argu-
  147. ment.
  148. <STRONG>E_BAD_STATE</STRONG>
  149. Routine was called from an initialization or termina-
  150. tion function.
  151. <STRONG>E_NO_MATCH</STRONG>
  152. Character failed to match.
  153. <STRONG>E_NO_ROOM</STRONG>
  154. Menu is too large for its window.
  155. <STRONG>E_NOT_CONNECTED</STRONG>
  156. No items are connected to the menu.
  157. <STRONG>E_NOT_POSTED</STRONG>
  158. The menu has not been posted.
  159. <STRONG>E_NOT_SELECTABLE</STRONG>
  160. The designated item cannot be selected.
  161. <STRONG>E_POSTED</STRONG>
  162. The menu is already posted.
  163. <STRONG>E_REQUEST_DENIED</STRONG>
  164. The menu driver could not process the request.
  165. <STRONG>E_SYSTEM_ERROR</STRONG>
  166. System error occurred (see <STRONG>errno</STRONG>).
  167. <STRONG>E_UNKNOWN_COMMAND</STRONG>
  168. The menu driver code saw an unknown request code.
  169. </PRE>
  170. <H2>SEE ALSO</H2><PRE>
  171. <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for
  172. detailed descriptions of the entry points.
  173. </PRE>
  174. <H2>NOTES</H2><PRE>
  175. The header file <STRONG>&lt;menu.h&gt;</STRONG> automatically includes the header
  176. files <STRONG>&lt;curses.h&gt;</STRONG> and <STRONG>&lt;eti.h&gt;</STRONG>.
  177. In your library list, libmenu.a should be before libn-
  178. curses.a; that is, you want to say `-lmenu -lncurses', not
  179. the other way around (which would usually give a link-
  180. error).
  181. </PRE>
  182. <H2>PORTABILITY</H2><PRE>
  183. These routines emulate the System V menu library. They
  184. were not supported on Version 7 or BSD versions.
  185. </PRE>
  186. <H2>AUTHORS</H2><PRE>
  187. Juergen Pfeifer. Manual pages and adaptation for ncurses
  188. by Eric S. Raymond.
  189. </PRE>
  190. <H2>SEE ALSO</H2><PRE>
  191. This describes <STRONG>ncurses</STRONG> version 5.6 (patch 20081011).
  192. <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG>
  193. </PRE>
  194. <HR>
  195. <ADDRESS>
  196. Man(1) output converted with
  197. <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
  198. </ADDRESS>
  199. </BODY>
  200. </HTML>