1<!-- 2 * t 3 **************************************************************************** 4 * Copyright 2018-2023,2024 Thomas E. Dickey * 5 * Copyright 1998-2014,2017 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.45 2024/03/16 15:35:01 tom Exp @ 32--> 33<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> 34<HTML> 35<HEAD> 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 2024-03-16 ncurses 6.5 Library calls</TITLE> 39<link rel="author" href="mailto:bug-ncurses@gnu.org"> 40 41</HEAD> 42<BODY> 43<H1 class="no-header">menu 3x 2024-03-16 ncurses 6.5 Library calls</H1> 44<PRE> 45<STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> Library calls <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> 46 47 48 49 50</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE> 51 <STRONG>menu</STRONG> - curses extension for programming menus 52 53 54</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> 55 <STRONG>#include</STRONG> <STRONG><menu.h></STRONG> 56 57 58</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> 59 The <STRONG>menu</STRONG> 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. 64 65 The <STRONG>menu</STRONG> library uses the <STRONG>curses</STRONG> libraries, and a curses initialization 66 routine such as <STRONG>initscr</STRONG> must be called before using any of these 67 functions. To use the <STRONG>menu</STRONG> library, link with the options <STRONG>-lmenu</STRONG> 68 <STRONG>-lcurses</STRONG>. 69 70 71</PRE><H3><a name="h3-Current-Default-Values-for-Item-Attributes">Current Default Values for Item Attributes</a></H3><PRE> 72 The <STRONG>menu</STRONG> library maintains a default value for item attributes. You 73 can get or set this default by calling the appropriate <STRONG>get_</STRONG> or <STRONG>set_</STRONG> 74 routine with a <STRONG>NULL</STRONG> item pointer. Changing this default with a <STRONG>set_</STRONG> 75 function affects future item creations, but does not change the 76 rendering of items already created. 77 78 79</PRE><H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE> 80 The following table lists each <STRONG>menu</STRONG> routine and the name of the manual 81 page on which it is described. 82 83 <STRONG>curses</STRONG> Routine Name Manual Page Name 84 -------------------------------------------- 85 current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> 86 free_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3x)</A></STRONG> 87 free_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3x)</A></STRONG> 88 item_count <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG> 89 item_description <STRONG><A HREF="mitem_name.3x.html">mitem_name(3x)</A></STRONG> 90 item_index <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> 91 item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 92 item_name <STRONG><A HREF="mitem_name.3x.html">mitem_name(3x)</A></STRONG> 93 item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> 94 item_opts_off <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> 95 item_opts_on <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> 96 item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 97 item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></STRONG> 98 item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3x)</A></STRONG> 99 item_visible <STRONG><A HREF="mitem_visible.3x.html">mitem_visible(3x)</A></STRONG> 100 menu_back <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 101 menu_driver <STRONG><A HREF="menu_driver.3x.html">menu_driver(3x)</A></STRONG> 102 menu_fore <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 103 menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3x)</A></STRONG> 104 menu_grey <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 105 menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 106 menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG> 107 menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3x)</A></STRONG> 108 menu_opts <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG> 109 menu_opts_off <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG> 110 menu_opts_on <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG> 111 menu_pad <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 112 menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></STRONG> 113 menu_request_by_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></STRONG> 114 menu_request_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></STRONG> 115 116 menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></STRONG> 117 menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> 118 menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 119 menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></STRONG> 120 menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> 121 new_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3x)</A></STRONG> 122 new_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3x)</A></STRONG> 123 pos_menu_cursor <STRONG><A HREF="menu_cursor.3x.html">menu_cursor(3x)</A></STRONG> 124 post_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3x)</A></STRONG> 125 scale_menu <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> 126 set_current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> 127 set_item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 128 set_item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> 129 set_item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 130 set_item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></STRONG> 131 set_item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3x)</A></STRONG> 132 set_menu_back <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 133 set_menu_fore <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 134 set_menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3x)</A></STRONG> 135 set_menu_grey <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 136 set_menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 137 set_menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG> 138 set_menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3x)</A></STRONG> 139 set_menu_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> 140 set_menu_pad <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> 141 set_menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></STRONG> 142 set_menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></STRONG> 143 set_menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> 144 set_menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> 145 set_menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></STRONG> 146 set_menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> 147 set_top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> 148 top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> 149 unpost_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3x)</A></STRONG> 150 151 152</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> 153 Routines that return pointers return <STRONG>NULL</STRONG> on error. Routines that 154 return an integer return one of the following error codes: 155 156 <STRONG>E_OK</STRONG> The routine succeeded. 157 158 <STRONG>E_BAD_ARGUMENT</STRONG> 159 Routine detected an incorrect or out-of-range argument. 160 161 <STRONG>E_BAD_STATE</STRONG> 162 Routine was called from an initialization or termination function. 163 164 <STRONG>E_NO_MATCH</STRONG> 165 Character failed to match. 166 167 <STRONG>E_NO_ROOM</STRONG> 168 Menu is too large for its window. 169 170 <STRONG>E_NOT_CONNECTED</STRONG> 171 No items are connected to the menu. 172 173 <STRONG>E_NOT_POSTED</STRONG> 174 The menu has not been posted. 175 176 <STRONG>E_NOT_SELECTABLE</STRONG> 177 The designated item cannot be selected. 178 179 <STRONG>E_POSTED</STRONG> 180 The menu is already posted. 181 182 <STRONG>E_REQUEST_DENIED</STRONG> 183 The menu driver could not process the request. 184 185 <STRONG>E_SYSTEM_ERROR</STRONG> 186 System error occurred (see <STRONG>errno(3)</STRONG>). 187 188 <STRONG>E_UNKNOWN_COMMAND</STRONG> 189 The menu driver code saw an unknown request code. 190 191 192</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE> 193 The header file <EM>menu.h</EM> itself includes the header file <EM>curses.h</EM>. 194 195 196</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> 197 These routines emulate the System V menu library. They were not 198 supported on Version 7 or BSD versions. 199 200 A menu facility was documented in SVr4.2's <EM>Character</EM> <EM>User</EM> <EM>Interface</EM> 201 <EM>Programming</EM> document. 202 203 It is not part of X/Open Curses. 204 205 Aside from <EM>ncurses</EM>, there are few implementations: 206 207 <STRONG>o</STRONG> systems based on SVr4 source code, e.g., Solaris. 208 209 <STRONG>o</STRONG> NetBSD curses. 210 211 212</PRE><H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE> 213 Juergen Pfeifer. Manual pages and adaptation for <EM>ncurses</EM> by Eric S. 214 Raymond. 215 216 217</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> 218 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for detailed 219 descriptions of the entry points. 220 221 222 223ncurses 6.5 2024-03-16 <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> 224</PRE> 225<div class="nav"> 226<ul> 227<li><a href="#h2-NAME">NAME</a></li> 228<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> 229<li><a href="#h2-DESCRIPTION">DESCRIPTION</a> 230<ul> 231<li><a href="#h3-Current-Default-Values-for-Item-Attributes">Current Default Values for Item Attributes</a></li> 232<li><a href="#h3-Routine-Name-Index">Routine Name Index</a></li> 233</ul> 234</li> 235<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> 236<li><a href="#h2-NOTES">NOTES</a></li> 237<li><a href="#h2-PORTABILITY">PORTABILITY</a></li> 238<li><a href="#h2-AUTHORS">AUTHORS</a></li> 239<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> 240</ul> 241</div> 242</BODY> 243</HTML> 244