4 <STRONG>menu</STRONG> - curses extension for programming menus
9 <STRONG>#include</STRONG> <STRONG><menu.h></STRONG>
13 <H2>DESCRIPTION</H2><PRE>
14 The <STRONG>menu</STRONG> library provides terminal-independent facilities
15 for composing menu systems on character-cell terminals.
16 The library includes: item routines, which create and mod-
17 ify menu items; and menu routines, which group items into
18 menus, display menus on the screen, and handle interaction
21 The <STRONG>menu</STRONG> library uses the <STRONG>curses</STRONG> libraries, and a curses
22 initialization routine such as <STRONG>initscr</STRONG> must be called
23 before using any of these functions. To use the <STRONG>menu</STRONG>
24 library, link with the options <STRONG>-lmenu</STRONG> <STRONG>-lcurses</STRONG>.
27 <STRONG>Current</STRONG> <STRONG>Default</STRONG> <STRONG>Values</STRONG> <STRONG>for</STRONG> <STRONG>Item</STRONG> <STRONG>Attributes</STRONG>
28 The <STRONG>menu</STRONG> library maintains a default value for item
29 attributes. You can get or set this default by calling
30 the appropriate <STRONG>get_</STRONG> or <STRONG>set_</STRONG> routine with a <STRONG>NULL</STRONG> item
31 pointer. Changing this default with a <STRONG>set_</STRONG> function
32 affects future item creations, but does not change the
33 rendering of items already created.
36 <STRONG>Routine</STRONG> <STRONG>Name</STRONG> <STRONG>Index</STRONG>
37 The following table lists each <STRONG>menu</STRONG> routine and the name
38 of the manual page on which it is described.
40 l l . <STRONG>curses</STRONG> Routine Name Manual Page Name =
41 current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3X)</A></STRONG> free_item
42 <STRONG><A HREF="mitem_new.3x.html">mitem_new(3X)</A></STRONG> free_menu <STRONG><A HREF="menu_new.3x.html">menu_new(3X)</A></STRONG>
43 item_count <STRONG><A HREF="menu_items.3x.html">menu_items(3X)</A></STRONG>
44 item_description <STRONG><A HREF="mitem_name.3x.html">mitem_name(3X)</A></STRONG>
45 item_index <STRONG><A HREF="mitem_current.3x.html">mitem_current(3X)</A></STRONG> item_init
46 <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG> item_name <STRONG><A HREF="mitem_name.3x.html">mitem_name(3X)</A></STRONG> item_opts
47 <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3X)</A></STRONG> item_opts_off <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3X)</A></STRONG>
48 item_opts_on <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3X)</A></STRONG> item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG>
49 item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3X)</A></STRONG>
50 item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3X)</A></STRONG> item_visible <STRONG>mitem_visi-</STRONG>
51 <STRONG><A HREF="ble.3x.html">ble(3X)</A></STRONG> menu_back <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG>
52 menu_driver <STRONG><A HREF="menu_driver.3x.html">menu_driver(3X)</A></STRONG> menu_fore
53 <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG> menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3X)</A></STRONG>
54 menu_grey <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG> menu_init
55 <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG> menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3X)</A></STRONG> menu_mark
56 <STRONG><A HREF="menu_mark.3x.html">menu_mark(3X)</A></STRONG> menu_opts <STRONG><A HREF="menu_opts.3x.html">menu_opts(3X)</A></STRONG>
57 menu_opts_off <STRONG><A HREF="menu_opts.3x.html">menu_opts(3X)</A></STRONG> menu_opts_on <STRONG><A HREF="menu_opts.3x.html">menu_opts(3X)</A></STRONG>
58 menu_pad <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG> menu_pattern <STRONG>menu_pat-</STRONG>
59 <STRONG><A HREF="tern.3x.html">tern(3X)</A></STRONG> menu_request_by_name <STRONG><A HREF="menu_requestname.3x.html">menu_requestname(3X)</A></STRONG>
60 <STRONG><A HREF="menu_win.3x.html">menu_win(3X)</A></STRONG> menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG>
61 menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3X)</A></STRONG> menu_win
62 <STRONG><A HREF="menu_win.3x.html">menu_win(3X)</A></STRONG> new_item <STRONG><A HREF="mitem_new.3x.html">mitem_new(3X)</A></STRONG> new_menu
63 <STRONG><A HREF="menu_new.3x.html">menu_new(3X)</A></STRONG> pos_menu_cursor <STRONG><A HREF="menu_cursor.3x.html">menu_cursor(3X)</A></STRONG>
64 post_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3X)</A></STRONG> scale_menu <STRONG><A HREF="menu_win.3x.html">menu_win(3X)</A></STRONG>
65 set_current_item <STRONG><A HREF="mitem_current.3x.html">mitem_current(3X)</A></STRONG>
66 set_item_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG> set_item_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3X)</A></STRONG>
67 set_item_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG>
68 set_item_userptr <STRONG><A HREF="mitem_userptr.3x.html">mitem_userptr(3X)</A></STRONG>
69 set_item_value <STRONG><A HREF="mitem_value.3x.html">mitem_value(3X)</A></STRONG>
70 set_menu_back <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG>
71 set_menu_fore <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG>
72 set_menu_format <STRONG><A HREF="menu_format.3x.html">menu_format(3X)</A></STRONG>
73 set_menu_grey <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG>
74 set_menu_init <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG> set_menu_items <STRONG><A HREF="menu_items.3x.html">menu_items(3X)</A></STRONG>
75 set_menu_mark <STRONG><A HREF="menu_mark.3x.html">menu_mark(3X)</A></STRONG> set_menu_opts <STRONG><A HREF="mitem_opts.3x.html">mitem_opts(3X)</A></STRONG>
76 set_menu_pad <STRONG><A HREF="menu_attribs.3x.html">menu_attribs(3X)</A></STRONG>
77 set_menu_pattern <STRONG><A HREF="menu_pattern.3x.html">menu_pattern(3X)</A></STRONG>
78 set_menu_spacing <STRONG><A HREF="menu_spacing.3x.html">menu_spacing(3X)</A></STRONG>
79 set_menu_sub <STRONG><A HREF="menu_win.3x.html">menu_win(3X)</A></STRONG> set_menu_term <STRONG><A HREF="menu_hook.3x.html">menu_hook(3X)</A></STRONG>
80 set_menu_userptr <STRONG><A HREF="menu_userptr.3x.html">menu_userptr(3X)</A></STRONG>
81 set_menu_win <STRONG><A HREF="menu_win.3x.html">menu_win(3X)</A></STRONG> set_top_row <STRONG>mitem_cur-</STRONG>
82 <STRONG><A HREF="rent.3x.html">rent(3X)</A></STRONG> top_row <STRONG><A HREF="mitem_current.3x.html">mitem_current(3X)</A></STRONG>
83 unpost_menu <STRONG><A HREF="menu_post.3x.html">menu_post(3X)</A></STRONG>
87 <H2>RETURN VALUE</H2><PRE>
88 Routines that return pointers return <STRONG>NULL</STRONG> on error. Rou-
89 tines that return an integer return one of the following
92 <STRONG>E_OK</STRONG> The routine succeeded.
94 <STRONG>E_SYSTEM_ERROR</STRONG>
95 System error occurred (see <STRONG>errno</STRONG>).
97 <STRONG>E_BAD_ARGUMENT</STRONG>
98 Routine detected an incorrect or out-of-range argu-
101 <STRONG>E_POSTED</STRONG>
102 The menu is already posted.
104 <STRONG>E_BAD_STATE</STRONG>
105 Routine was called from an initialization or termina-
108 <STRONG>E_NO_ROOM</STRONG>
109 Menu is too large for its window.
111 <STRONG>E_NOT_POSTED</STRONG>
112 The menu has not been posted.
114 The menu driver code saw an unknown request code.
116 <STRONG>E_NO_MATCH</STRONG>
117 Character failed to match.
119 <STRONG>E_NOT_SELECTABLE</STRONG>
120 The designated item cannot be selected.
122 <STRONG>E_NOT_CONNECTED</STRONG>
123 No items are connected to the menu.
125 <STRONG>E_REQUEST_DENIED</STRONG>
126 The menu driver could not process the request.
130 <H2>SEE ALSO</H2><PRE>
131 <STRONG><A HREF="ncurses.3x.html">curses(3X)</A></STRONG> and 3X pages whose names begin "menu_" for
132 detailed descriptions of the entry points.
137 The header file <STRONG><menu.h></STRONG> automatically includes the header
138 files <STRONG><curses.h></STRONG> and <STRONG><eti.h></STRONG>.
140 In your library list, libmenu.a should be before libn-
141 curses.a; that is, you want to say `-lmenu -lncurses', not
142 the other way around (which would give you a link error
143 using GNU <STRONG><A HREF="ld.1.html">ld(1)</A></STRONG> and many other linkers).
147 <H2>PORTABILITY</H2><PRE>
148 These routines emulate the System V menu library. They
149 were not supported on Version 7 or BSD versions.
153 <H2>AUTHORS</H2><PRE>
154 Juergen Pfeifer. Manual pages and adaptation for ncurses