3 ****************************************************************************
4 * Copyright 2018-2019,2020 Thomas E. Dickey *
5 * Copyright 1998-2014,2017 Free Software Foundation, Inc. *
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: *
15 * The above copyright notice and this permission notice shall be included *
16 * in all copies or substantial portions of the Software. *
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. *
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 *
30 ****************************************************************************
31 * @Id: menu.3x,v 1.27 2020/02/02 23:34:34 tom Exp @
33 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
36 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
37 <meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts">
38 <TITLE>menu 3X</TITLE>
39 <link rel="author" href="mailto:bug-ncurses@gnu.org">
40 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
43 <H1 class="no-header">menu 3X</H1>
45 <B><A HREF="menu.3X.html">menu(3X)</A></B> <B><A HREF="menu.3X.html">menu(3X)</A></B>
50 </PRE><H2><a name="h2-NAME">NAME</a></H2><PRE>
51 <B>menu</B> - curses extension for programming menus
54 </PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE>
55 <B>#include</B> <B><menu.h></B>
58 </PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE>
59 The <B>menu</B> library provides terminal-independent facilities for composing
60 menu systems on character-cell terminals. The library includes: item
61 routines, which create and modify menu items; and menu routines, which
62 group items into menus, display menus on the screen, and handle
63 interaction with the user.
65 The <B>menu</B> library uses the <B>curses</B> libraries, and a curses initialization
66 routine such as <B>initscr</B> must be called before using any of these
67 functions. To use the <B>menu</B> library, link with the options <B>-lmenu</B>
71 </PRE><H3><a name="h3-Current-Default-Values-for-Item-Attributes">Current Default Values for Item Attributes</a></H3><PRE>
72 The <B>menu</B> library maintains a default value for item attributes. You
73 can get or set this default by calling the appropriate <B>get_</B> or <B>set_</B>
74 routine with a <B>NULL</B> item pointer. Changing this default with a <B>set_</B>
75 function affects future item creations, but does not change the
76 rendering of items already created.
79 </PRE><H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE>
80 The following table lists each <B>menu</B> routine and the name of the manual
81 page on which it is described.
83 <B>curses</B> Routine Name Manual Page Name
84 --------------------------------------------
85 current_item <B><A HREF="mitem_current.3X.html">mitem_current(3X)</A></B>
86 free_item <B><A HREF="mitem_new.3X.html">mitem_new(3X)</A></B>
87 free_menu <B><A HREF="menu_new.3X.html">menu_new(3X)</A></B>
88 item_count <B><A HREF="menu_items.3X.html">menu_items(3X)</A></B>
89 item_description <B><A HREF="mitem_name.3X.html">mitem_name(3X)</A></B>
90 item_index <B><A HREF="mitem_current.3X.html">mitem_current(3X)</A></B>
91 item_init <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
92 item_name <B><A HREF="mitem_name.3X.html">mitem_name(3X)</A></B>
93 item_opts <B><A HREF="mitem_opts.3X.html">mitem_opts(3X)</A></B>
94 item_opts_off <B><A HREF="mitem_opts.3X.html">mitem_opts(3X)</A></B>
95 item_opts_on <B><A HREF="mitem_opts.3X.html">mitem_opts(3X)</A></B>
96 item_term <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
97 item_userptr <B><A HREF="mitem_userptr.3X.html">mitem_userptr(3X)</A></B>
98 item_value <B><A HREF="mitem_value.3X.html">mitem_value(3X)</A></B>
99 item_visible <B><A HREF="mitem_visible.3X.html">mitem_visible(3X)</A></B>
100 menu_back <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
101 menu_driver <B><A HREF="menu_driver.3X.html">menu_driver(3X)</A></B>
102 menu_fore <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
103 menu_format <B><A HREF="menu_format.3X.html">menu_format(3X)</A></B>
104 menu_grey <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
105 menu_init <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
106 menu_items <B><A HREF="menu_items.3X.html">menu_items(3X)</A></B>
107 menu_mark <B><A HREF="menu_mark.3X.html">menu_mark(3X)</A></B>
108 menu_opts <B><A HREF="menu_opts.3X.html">menu_opts(3X)</A></B>
109 menu_opts_off <B><A HREF="menu_opts.3X.html">menu_opts(3X)</A></B>
110 menu_opts_on <B><A HREF="menu_opts.3X.html">menu_opts(3X)</A></B>
111 menu_pad <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
112 menu_pattern <B><A HREF="menu_pattern.3X.html">menu_pattern(3X)</A></B>
113 menu_request_by_name <B><A HREF="menu_requestname.3X.html">menu_requestname(3X)</A></B>
114 menu_request_name <B><A HREF="menu_requestname.3X.html">menu_requestname(3X)</A></B>
116 menu_spacing <B><A HREF="menu_spacing.3X.html">menu_spacing(3X)</A></B>
117 menu_sub <B><A HREF="menu_win.3X.html">menu_win(3X)</A></B>
118 menu_term <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
119 menu_userptr <B><A HREF="menu_userptr.3X.html">menu_userptr(3X)</A></B>
120 menu_win <B><A HREF="menu_win.3X.html">menu_win(3X)</A></B>
121 new_item <B><A HREF="mitem_new.3X.html">mitem_new(3X)</A></B>
122 new_menu <B><A HREF="menu_new.3X.html">menu_new(3X)</A></B>
123 pos_menu_cursor <B><A HREF="menu_cursor.3X.html">menu_cursor(3X)</A></B>
124 post_menu <B><A HREF="menu_post.3X.html">menu_post(3X)</A></B>
125 scale_menu <B><A HREF="menu_win.3X.html">menu_win(3X)</A></B>
126 set_current_item <B><A HREF="mitem_current.3X.html">mitem_current(3X)</A></B>
127 set_item_init <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
128 set_item_opts <B><A HREF="mitem_opts.3X.html">mitem_opts(3X)</A></B>
129 set_item_term <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
130 set_item_userptr <B><A HREF="mitem_userptr.3X.html">mitem_userptr(3X)</A></B>
131 set_item_value <B><A HREF="mitem_value.3X.html">mitem_value(3X)</A></B>
132 set_menu_back <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
133 set_menu_fore <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
134 set_menu_format <B><A HREF="menu_format.3X.html">menu_format(3X)</A></B>
135 set_menu_grey <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
136 set_menu_init <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
137 set_menu_items <B><A HREF="menu_items.3X.html">menu_items(3X)</A></B>
138 set_menu_mark <B><A HREF="menu_mark.3X.html">menu_mark(3X)</A></B>
139 set_menu_opts <B><A HREF="mitem_opts.3X.html">mitem_opts(3X)</A></B>
140 set_menu_pad <B><A HREF="menu_attributes.3X.html">menu_attributes(3X)</A></B>
141 set_menu_pattern <B><A HREF="menu_pattern.3X.html">menu_pattern(3X)</A></B>
142 set_menu_spacing <B><A HREF="menu_spacing.3X.html">menu_spacing(3X)</A></B>
143 set_menu_sub <B><A HREF="menu_win.3X.html">menu_win(3X)</A></B>
144 set_menu_term <B><A HREF="menu_hook.3X.html">menu_hook(3X)</A></B>
145 set_menu_userptr <B><A HREF="menu_userptr.3X.html">menu_userptr(3X)</A></B>
146 set_menu_win <B><A HREF="menu_win.3X.html">menu_win(3X)</A></B>
147 set_top_row <B><A HREF="mitem_current.3X.html">mitem_current(3X)</A></B>
148 top_row <B><A HREF="mitem_current.3X.html">mitem_current(3X)</A></B>
149 unpost_menu <B><A HREF="menu_post.3X.html">menu_post(3X)</A></B>
152 </PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE>
153 Routines that return pointers return <B>NULL</B> on error. Routines that
154 return an integer return one of the following error codes:
156 <B>E_OK</B> The routine succeeded.
158 <B>E_BAD_ARGUMENT</B>
159 Routine detected an incorrect or out-of-range argument.
162 Routine was called from an initialization or termination function.
165 Character failed to match.
168 Menu is too large for its window.
170 <B>E_NOT_CONNECTED</B>
171 No items are connected to the menu.
174 The menu has not been posted.
176 <B>E_NOT_SELECTABLE</B>
177 The designated item cannot be selected.
180 The menu is already posted.
182 <B>E_REQUEST_DENIED</B>
183 The menu driver could not process the request.
185 <B>E_SYSTEM_ERROR</B>
186 System error occurred (see <B>errno(3)</B>).
188 <B>E_UNKNOWN_COMMAND</B>
189 The menu driver code saw an unknown request code.
192 </PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE>
193 The header file <B><menu.h></B> automatically includes the header files
194 <B><curses.h></B> and <B><eti.h></B>.
196 In your library list, libmenu.a should be before libncurses.a; that is,
197 you should say "-lmenu -lncurses", not the other way around (which
198 would give a link-error when using static libraries).
201 </PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE>
202 These routines emulate the System V menu library. They were not
203 supported on Version 7 or BSD versions.
205 The menu facility was documented in SVr4.2 in <I>Character</I> <I>User</I> <I>Interface</I>
206 <I>Programming</I> <I>(UNIX</I> <I>SVR4.2)</I>.
208 It is not part of X/Open Curses.
210 Aside from ncurses, there are few implementations:
212 <B>o</B> systems based on SVr4 source code, e.g., Solaris.
214 <B>o</B> NetBSD curses.
217 </PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE>
218 Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric S.
222 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
223 <B><A HREF="curses.3X.html">curses(3X)</A></B> and related pages whose names begin "menu_" for detailed
224 descriptions of the entry points.
226 This describes <B>ncurses</B> version 6.2 (patch 20210612).
230 <B><A HREF="menu.3X.html">menu(3X)</A></B>
234 <li><a href="#h2-NAME">NAME</a></li>
235 <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li>
236 <li><a href="#h2-DESCRIPTION">DESCRIPTION</a>
238 <li><a href="#h3-Current-Default-Values-for-Item-Attributes">Current Default Values for Item Attributes</a></li>
239 <li><a href="#h3-Routine-Name-Index">Routine Name Index</a></li>
242 <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li>
243 <li><a href="#h2-NOTES">NOTES</a></li>
244 <li><a href="#h2-PORTABILITY">PORTABILITY</a></li>
245 <li><a href="#h2-AUTHORS">AUTHORS</a></li>
246 <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li>