1menus(3CURSES) Curses Library Functions menus(3CURSES)
2
3
4
6 menus - character based menus package
7
9 #include <menu.h>
10
11
13 The menu library is built using the curses library, and any program
14 using menus routines must call one of the curses initialization rou‐
15 tines, such as initscr. A program using these routines must be compiled
16 with -lmenu and -lcurses on the cc command line.
17
18
19 The menus package gives the applications programmer a terminal-indepen‐
20 dent method of creating and customizing menus for user interaction. The
21 menus package includes: item routines, which are used to create and
22 customize menu items; and menu routines, which are used to create and
23 customize menus, assign pre- and post-processing routines, and display
24 and interact with menus.
25
26 Current Default Values for Item Attributes
27 The menus package establishes initial current default values for item
28 attributes. During item initialization, each item attribute is assigned
29 the current default value for that attribute. An application can change
30 or retrieve a current default attribute value by calling the appropri‐
31 ate set or retrieve routine with a NULL item pointer. If an application
32 changes a current default item attribute value, subsequent items cre‐
33 ated using new_item() will have the new default attribute value. The
34 attributes of previously created items are not changed if a current
35 default attribute value is changed.
36
37 Routine Name Index
38 The following table lists each menus routine and the name of the manual
39 page on which it is described.
40
41
42
43
44 Menus Routine Name Manual Page Name
45 current_item menu_item_current(3X)
46 free_item menu_item_new(3X)
47 free_menu menu_new(3X)
48 item_count menu_items(3X)
49 item_description menu_item_name(3X)
50 item_index menu_item_current(3X)
51 item_init menu_hook(3X)
52 item_name menu_item_name(3X)
53 item_opts menu_item_opts(3X)
54 item_opts_off menu_item_opts(3X)
55 item_opts_on menu_item_opts(3X)
56 item_term menu_hook(3X)
57 item_userptr menu_item_userptr(3X)
58 item_value menu_item_value(3X)
59 item_visible menu_item_visible(3X)
60 menu_back menu_attributes(3X)
61 menu_driver menu_driver(3X)
62 menu_fore menu_attributes(3X)
63 menu_format menu_format(3X)
64 menu_grey menu_attributes(3X)
65 menu_init menu_hook(3X)
66
67 menu_items menu_items(3X)
68 menu_mark menu_mark(3X)
69 menu_opts menu_opts(3X)
70 menu_opts_off menu_opts(3X)
71 menu_opts_on menu_opts(3X)
72 menu_pad menu_attributes(3X)
73 menu_pattern menu_pattern(3X)
74 menu_sub menu_win(3X)
75 menu_term menu_hook(3X)
76 menu_userptr menu_userptr(3X)
77 menu_win menu_win(3X)
78 new_item menu_item_new(3X)
79 new_menu menu_new(3X)
80 pos_menu_cursor menu_cursor(3X)
81 post_menu menu_post(3X)
82 scale_menu menu_win(3X)
83 set_current_item menu_item_current(3X)
84 set_item_init menu_hook(3X)
85 set_item_opts menu_item_opts(3X)
86 set_item_term menu_hook(3X)
87 set_item_userptr menu_item_userptr(3X)
88 set_item_value menu_item_value(3X)
89 set_menu_back menu_attributes(3X)
90 set_menu_fore menu_attributes(3X)
91 set_menu_format menu_format(3X)
92 set_menu_grey menu_attributes(3X)
93 set_menu_init menu_hook(3X)
94 set_menu_items menu_items(3X)
95 set_menu_mark menu_mark(3X)
96 set_menu_opts menu_opts(3X)
97 set_menu_pad menu_attributes(3X)
98 set_menu_pattern menu_pattern(3X)
99 set_menu_sub menu_win(3X)
100 set_menu_term menu_hook(3X)
101 set_menu_userptr menu_userptr(3X)
102 set_menu_win menu_win(3X)
103 set_top_row menu_item_current(3X)
104 top_row menu_item_current(3X)
105 unpost_menu menu_post(3X)
106
107
109 Routines that return pointers always return NULL on error. Routines
110 that return an integer return one of the following:
111
112 E_OK The routine returned successfully.
113
114
115 E_SYSTEM_ERROR System error.
116
117
118 E_BAD_ARGUMENT An incorrect argument was passed to the routine.
119
120
121 E_POSTED The menu is already posted.
122
123
124 E_CONNECTED One or more items are already connected to another
125 menu.
126
127
128 E_BAD_STATE The routine was called from an initialization or
129 termination function.
130
131
132 E_NO_ROOM The menu does not fit within its subwindow.
133
134
135 E_NOT_POSTED The menu has not been posted.
136
137
138 E_UNKNOWN_COMMAND An unknown request was passed to the menu driver.
139
140
141 E_NO_MATCH The character failed to match.
142
143
144 E_NOT_SELECTABLE The item cannot be selected.
145
146
147 E_NOT_CONNECTED No items are connected to the menu.
148
149
150 E_REQUEST_DENIED The menu driver could not process the request.
151
152
154 See attributes(5) for descriptions of the following attributes:
155
156
157
158
159 ┌─────────────────────────────┬─────────────────────────────┐
160 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
161 ├─────────────────────────────┼─────────────────────────────┤
162 │MT-Level │Unsafe │
163 └─────────────────────────────┴─────────────────────────────┘
164
166 curses(3CURSES), attributes(5)
167
169 The header <menu.h> automatically includes the headers <eti.h> and
170 <curses.h>.
171
172
173
174SunOS 5.11 31 Dec 1996 menus(3CURSES)