2 .\" $Id: menu.3x,v 1.10 1997/12/14 01:45:52 tom Exp $
5 \fBmenu\fR - curses extension for programming menus
7 \fB#include <menu.h>\fR
10 The \fBmenu\fR library provides terminal-independent facilities for composing
11 menu systems on character-cell terminals. The library includes: item routines,
12 which create and modify menu items; and menu routines, which group items into
13 menus, display menus on the screen, and handle interaction with the user.
15 The \fBmenu\fR library uses the \fBcurses\fR libraries, and a curses
16 initialization routine such as \fBinitscr\fR must be called before using any of
17 these functions. To use the \fBmenu\fR library, link with the options
18 \fB-lmenu -lcurses\fR.
20 .SS Current Default Values for Item Attributes
22 The \fBmenu\fR library maintains a default value for item attributes. You can
23 get or set this default by calling the appropriate \fBget_\fR or \fBset_\fR
24 routine with a \fBNULL\fR item pointer. Changing this default with a
25 \fBset_\fR function affects future item creations, but does not change the
26 rendering of items already created.
28 .SS Routine Name Index
30 The following table lists each \fBmenu\fR routine and the name of
31 the manual page on which it is described.
35 \fBcurses\fR Routine Name Manual Page Name
37 current_item \fBmitem_current\fR(3X)
38 free_item \fBmitem_new\fR(3X)
39 free_menu \fBmenu_new\fR(3X)
40 item_count \fBmenu_items\fR(3X)
41 item_description \fBmitem_name\fR(3X)
42 item_index \fBmitem_current\fR(3X)
43 item_init \fBmenu_hook\fR(3X)
44 item_name \fBmitem_name\fR(3X)
45 item_opts \fBmitem_opts\fR(3X)
46 item_opts_off \fBmitem_opts\fR(3X)
47 item_opts_on \fBmitem_opts\fR(3X)
48 item_term \fBmenu_hook\fR(3X)
49 item_userptr \fBmitem_userptr\fR(3X)
50 item_value \fBmitem_value\fR(3X)
51 item_visible \fBmitem_visible\fR(3X)
52 menu_back \fBmenu_attribs\fR(3X)
53 menu_driver \fBmenu_driver\fR(3X)
54 menu_fore \fBmenu_attribs\fR(3X)
55 menu_format \fBmenu_format\fR(3X)
56 menu_grey \fBmenu_attribs\fR(3X)
57 menu_init \fBmenu_hook\fR(3X)
58 menu_items \fBmenu_items\fR(3X)
59 menu_mark \fBmenu_mark\fR(3X)
60 menu_opts \fBmenu_opts\fR(3X)
61 menu_opts_off \fBmenu_opts\fR(3X)
62 menu_opts_on \fBmenu_opts\fR(3X)
63 menu_pad \fBmenu_attribs\fR(3X)
64 menu_pattern \fBmenu_pattern\fR(3X)
65 menu_request_by_name \fBmenu_requestname\fR(3X)
66 menu_request_name \fBmenu_requestname\fR(3X)
67 menu_spacing \fBmenu_spacing\fR(3X)
68 menu_sub \fBmenu_win\fR(3X)
69 menu_term \fBmenu_hook\fR(3X)
70 menu_userptr \fBmenu_userptr\fR(3X)
71 menu_win \fBmenu_win\fR(3X)
72 new_item \fBmitem_new\fR(3X)
73 new_menu \fBmenu_new\fR(3X)
74 pos_menu_cursor \fBmenu_cursor\fR(3X)
75 post_menu \fBmenu_post\fR(3X)
76 scale_menu \fBmenu_win\fR(3X)
77 set_current_item \fBmitem_current\fR(3X)
78 set_item_init \fBmenu_hook\fR(3X)
79 set_item_opts \fBmitem_opts\fR(3X)
80 set_item_term \fBmenu_hook\fR(3X)
81 set_item_userptr \fBmitem_userptr\fR(3X)
82 set_item_value \fBmitem_value\fR(3X)
83 set_menu_back \fBmenu_attribs\fR(3X)
84 set_menu_fore \fBmenu_attribs\fR(3X)
85 set_menu_format \fBmenu_format\fR(3X)
86 set_menu_grey \fBmenu_attribs\fR(3X)
87 set_menu_init \fBmenu_hook\fR(3X)
88 set_menu_items \fBmenu_items\fR(3X)
89 set_menu_mark \fBmenu_mark\fR(3X)
90 set_menu_opts \fBmitem_opts\fR(3X)
91 set_menu_pad \fBmenu_attribs\fR(3X)
92 set_menu_pattern \fBmenu_pattern\fR(3X)
93 set_menu_spacing \fBmenu_spacing\fR(3X)
94 set_menu_sub \fBmenu_win\fR(3X)
95 set_menu_term \fBmenu_hook\fR(3X)
96 set_menu_userptr \fBmenu_userptr\fR(3X)
97 set_menu_win \fBmenu_win\fR(3X)
98 set_top_row \fBmitem_current\fR(3X)
99 top_row \fBmitem_current\fR(3X)
100 unpost_menu \fBmenu_post\fR(3X)
103 Routines that return pointers return \fBNULL\fR on error. Routines that return
104 an integer return one of the following error codes:
107 The routine succeeded.
110 System error occurred (see \fBerrno\fR).
113 Routine detected an incorrect or out-of-range argument.
116 The menu is already posted.
119 Routine was called from an initialization or termination function.
122 Menu is too large for its window.
125 The menu has not been posted.
127 \fBE_UNKNOWN_COMMAND\fR
128 The menu driver code saw an unknown request code.
131 Character failed to match.
133 \fBE_NOT_SELECTABLE\fR
134 The designated item cannot be selected.
136 \fBE_NOT_CONNECTED\fR
137 No items are connected to the menu.
139 \fBE_REQUEST_DENIED\fR
140 The menu driver could not process the request.
142 \fBcurses\fR(3X) and 3X pages whose names begin "menu_" for detailed
143 descriptions of the entry points.
145 The header file \fB<menu.h>\fR automatically includes the header files
146 \fB<curses.h>\fR and \fB<eti.h>\fR.
148 In your library list, libmenu.a should be before libncurses.a; that is,
149 you want to say `-lmenu -lncurses', not the other way around (which would
150 give you a link error using GNU \fBld\fR(1) and many other linkers).
152 These routines emulate the System V menu library. They were not supported on
153 Version 7 or BSD versions.
155 Juergen Pfeifer. Manual pages and adaptation for ncurses by Eric
158 .\"# The following sets edit modes for GNU EMACS
159 .\"# Local Variables: