Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | * t |
| 3 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 4 | * Copyright (c) 1998-2010,2014 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 30 | * @Id: menu.3x,v 1.22 2014/08/16 20:32:08 tom Exp @ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 31 | --> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 32 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 33 | <HTML> |
| 34 | <HEAD> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 35 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 36 | <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 37 | <TITLE>menu 3x</TITLE> |
| 38 | <link rev=made href="mailto:bug-ncurses@gnu.org"> |
| 39 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 40 | </HEAD> |
| 41 | <BODY> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 42 | <H1 class="no-header">menu 3x</H1> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 43 | <PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 44 | <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 50 | <H2><a name="h2-NAME">NAME</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 51 | <STRONG>menu</STRONG> - curses extension for programming menus |
| 52 | |
| 53 | |
| 54 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 55 | <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 56 | <STRONG>#include</STRONG> <STRONG><menu.h></STRONG> |
| 57 | |
| 58 | |
| 59 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 60 | <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 61 | The <STRONG>menu</STRONG> library provides terminal-independent facilities |
| 62 | for composing menu systems on character-cell terminals. |
| 63 | The library includes: item routines, which create and mod- |
| 64 | ify menu items; and menu routines, which group items into |
| 65 | menus, display menus on the screen, and handle interaction |
| 66 | with the user. |
| 67 | |
| 68 | The <STRONG>menu</STRONG> library uses the <STRONG>curses</STRONG> libraries, and a curses |
| 69 | initialization routine such as <STRONG>initscr</STRONG> must be called |
| 70 | before using any of these functions. To use the <STRONG>menu</STRONG> |
| 71 | library, link with the options <STRONG>-lmenu</STRONG> <STRONG>-lcurses</STRONG>. |
| 72 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 73 | |
| 74 | </PRE> |
| 75 | <H3><a name="h3-Current-Default-Values-for-Item-Attributes">Current Default Values for Item Attributes</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 76 | The <STRONG>menu</STRONG> library maintains a default value for item |
| 77 | attributes. You can get or set this default by calling |
| 78 | the appropriate <STRONG>get_</STRONG> or <STRONG>set_</STRONG> routine with a <STRONG>NULL</STRONG> item |
| 79 | pointer. Changing this default with a <STRONG>set_</STRONG> function |
| 80 | affects future item creations, but does not change the |
| 81 | rendering of items already created. |
| 82 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 83 | |
| 84 | </PRE> |
| 85 | <H3><a name="h3-Routine-Name-Index">Routine Name Index</a></H3><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 86 | The following table lists each <STRONG>menu</STRONG> routine and the name |
| 87 | of the manual page on which it is described. |
| 88 | |
| 89 | <STRONG>curses</STRONG> Routine Name Manual Page Name |
| 90 | -------------------------------------------- |
| 91 | current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> |
| 92 | free_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3x)</A></STRONG> |
| 93 | free_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3x)</A></STRONG> |
| 94 | item_count <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG> |
| 95 | item_description <STRONG><A HREF="mitem_name.3x.html">mitem_name(3x)</A></STRONG> |
| 96 | item_index <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> |
| 97 | item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 98 | item_name <STRONG><A HREF="mitem_name.3x.html">mitem_name(3x)</A></STRONG> |
| 99 | item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> |
| 100 | item_opts_off <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> |
| 101 | item_opts_on <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> |
| 102 | item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 103 | item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></STRONG> |
| 104 | item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3x)</A></STRONG> |
| 105 | item_visible <STRONG><A HREF="mitem_visible.3x.html">mitem_visible(3x)</A></STRONG> |
| 106 | menu_back <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 107 | menu_driver <STRONG><A HREF="menu_driver.3x.html">menu_driver(3x)</A></STRONG> |
| 108 | menu_fore <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 109 | menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3x)</A></STRONG> |
| 110 | menu_grey <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 111 | menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 112 | menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG> |
| 113 | menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3x)</A></STRONG> |
| 114 | menu_opts <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG> |
| 115 | menu_opts_off <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG> |
| 116 | menu_opts_on <STRONG><A HREF="menu_opts.3x.html">menu_opts(3x)</A></STRONG> |
| 117 | menu_pad <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 118 | menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></STRONG> |
| 119 | |
| 120 | menu_request_by_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></STRONG> |
| 121 | menu_request_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></STRONG> |
| 122 | menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></STRONG> |
| 123 | menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> |
| 124 | menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 125 | menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></STRONG> |
| 126 | menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> |
| 127 | new_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3x)</A></STRONG> |
| 128 | new_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3x)</A></STRONG> |
| 129 | pos_menu_cursor <STRONG><A HREF="menu_cursor.3x.html">menu_cursor(3x)</A></STRONG> |
| 130 | post_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3x)</A></STRONG> |
| 131 | scale_menu <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> |
| 132 | set_current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> |
| 133 | set_item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 134 | set_item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> |
| 135 | set_item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 136 | set_item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></STRONG> |
| 137 | set_item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3x)</A></STRONG> |
| 138 | set_menu_back <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 139 | set_menu_fore <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 140 | set_menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3x)</A></STRONG> |
| 141 | set_menu_grey <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 142 | set_menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 143 | set_menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3x)</A></STRONG> |
| 144 | set_menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3x)</A></STRONG> |
| 145 | set_menu_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></STRONG> |
| 146 | set_menu_pad <STRONG><A HREF="menu_attributes.3x.html">menu_attributes(3x)</A></STRONG> |
| 147 | set_menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></STRONG> |
| 148 | set_menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></STRONG> |
| 149 | set_menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> |
| 150 | set_menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3x)</A></STRONG> |
| 151 | set_menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></STRONG> |
| 152 | set_menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3x)</A></STRONG> |
| 153 | set_top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> |
| 154 | top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3x)</A></STRONG> |
| 155 | unpost_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3x)</A></STRONG> |
| 156 | |
| 157 | |
| 158 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 159 | <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 160 | Routines that return pointers return <STRONG>NULL</STRONG> on error. Rou- |
| 161 | tines that return an integer return one of the following |
| 162 | error codes: |
| 163 | |
| 164 | <STRONG>E_OK</STRONG> The routine succeeded. |
| 165 | |
| 166 | <STRONG>E_BAD_ARGUMENT</STRONG> |
| 167 | Routine detected an incorrect or out-of-range argu- |
| 168 | ment. |
| 169 | |
| 170 | <STRONG>E_BAD_STATE</STRONG> |
| 171 | Routine was called from an initialization or termina- |
| 172 | tion function. |
| 173 | |
| 174 | <STRONG>E_NO_MATCH</STRONG> |
| 175 | Character failed to match. |
| 176 | |
| 177 | <STRONG>E_NO_ROOM</STRONG> |
| 178 | Menu is too large for its window. |
| 179 | |
| 180 | <STRONG>E_NOT_CONNECTED</STRONG> |
| 181 | No items are connected to the menu. |
| 182 | |
| 183 | <STRONG>E_NOT_POSTED</STRONG> |
| 184 | The menu has not been posted. |
| 185 | |
| 186 | <STRONG>E_NOT_SELECTABLE</STRONG> |
| 187 | The designated item cannot be selected. |
| 188 | |
| 189 | <STRONG>E_POSTED</STRONG> |
| 190 | The menu is already posted. |
| 191 | |
| 192 | <STRONG>E_REQUEST_DENIED</STRONG> |
| 193 | The menu driver could not process the request. |
| 194 | |
| 195 | <STRONG>E_SYSTEM_ERROR</STRONG> |
| 196 | System error occurred (see <STRONG>errno</STRONG>). |
| 197 | |
| 198 | <STRONG>E_UNKNOWN_COMMAND</STRONG> |
| 199 | The menu driver code saw an unknown request code. |
| 200 | |
| 201 | |
| 202 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 203 | <H2><a name="h2-NOTES">NOTES</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 204 | The header file <STRONG><menu.h></STRONG> automatically includes the header |
| 205 | files <STRONG><curses.h></STRONG> and <STRONG><eti.h></STRONG>. |
| 206 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 207 | In your library list, libmenu.a should be before libn- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 208 | curses.a; that is, you want to say `-lmenu -lncurses', not |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 209 | the other way around (which would usually give a link- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 210 | error). |
| 211 | |
| 212 | |
| 213 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 214 | <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> |
| 215 | These routines emulate the System V menu library. They |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 216 | were not supported on Version 7 or BSD versions. |
| 217 | |
| 218 | |
| 219 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 220 | <H2><a name="h2-AUTHORS">AUTHORS</a></H2><PRE> |
| 221 | Juergen Pfeifer. Manual pages and adaptation for ncurses |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 222 | by Eric S. Raymond. |
| 223 | |
| 224 | |
| 225 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 226 | <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
| 227 | <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names begin "menu_" for |
| 228 | detailed descriptions of the entry points. |
| 229 | |
| 230 | This describes <STRONG>ncurses</STRONG> version 6.0 (patch 20150808). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 231 | |
| 232 | |
| 233 | |
| 234 | <STRONG><A HREF="menu.3x.html">menu(3x)</A></STRONG> |
| 235 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 236 | <div class="nav"> |
| 237 | <ul> |
| 238 | <li><a href="#h2-NAME">NAME</a></li> |
| 239 | <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 240 | <li><a href="#h2-DESCRIPTION">DESCRIPTION</a> |
| 241 | <ul> |
| 242 | <li><a href="#h3-Current-Default-Values-for-Item-Attributes">Current Default Values for Item Attributes</a></li> |
| 243 | <li><a href="#h3-Routine-Name-Index">Routine Name Index</a></li> |
| 244 | </ul> |
| 245 | </li> |
| 246 | <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> |
| 247 | <li><a href="#h2-NOTES">NOTES</a></li> |
| 248 | <li><a href="#h2-PORTABILITY">PORTABILITY</a></li> |
| 249 | <li><a href="#h2-AUTHORS">AUTHORS</a></li> |
| 250 | <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
| 251 | </ul> |
| 252 | </div> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 253 | </BODY> |
| 254 | </HTML> |