1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
'\" te
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH menus 3CURSES "31 Dec 1996" "SunOS 5.11" "Curses Library Functions"
.SH NAME
menus \- character based menus package
.SH SYNOPSIS
.LP
.nf
\fB#include <menu.h>\fR
.fi
.SH DESCRIPTION
.sp
.LP
The \fBmenu\fR library is built using the \fBcurses\fR library, and any program
using menus routines must call one of the \fBcurses\fR initialization routines,
such as \fBinitscr\fR. A program using these routines must be compiled with
\fB-lmenu\fR and \fB-lcurses\fR on the \fBcc\fR command line.
.sp
.LP
The menus package gives the applications programmer a terminal-independent
method of creating and customizing menus for user interaction. The menus
package includes: item routines, which are used to create and customize menu
items; and menu routines, which are used to create and customize menus, assign
pre- and post-processing routines, and display and interact with menus.
.SS "Current Default Values for Item Attributes"
.sp
.LP
The menus package establishes initial current default values for item
attributes. During item initialization, each item attribute is assigned the
current default value for that attribute. An application can change or retrieve
a current default attribute value by calling the appropriate set or retrieve
routine with a \fINULL\fR item pointer. If an application changes a current
default item attribute value, subsequent items created using \fBnew_item()\fR
will have the new default attribute value. The attributes of previously created
items are not changed if a current default attribute value is changed.
.SS "Routine Name Index"
.sp
.LP
The following table lists each menus routine and the name of the manual page on
which it is described.
.sp
.sp
.TS
tab();
cw(2.75i) cw(2.75i)
lw(2.75i) lw(2.75i)
.
\fBMenus Routine Name\fR\fBManual Page Name\fR
\fBcurrent_item\fR\fBmenu_item_current(3X)\fR
\fBfree_item\fR\fBmenu_item_new(3X)\fR
\fBfree_menu\fR\fBmenu_new(3X)\fR
\fBitem_count\fR\fBmenu_items(3X)\fR
\fBitem_description\fR\fBmenu_item_name(3X)\fR
\fBitem_index\fR\fBmenu_item_current(3X)\fR
\fBitem_init\fR\fBmenu_hook(3X)\fR
\fBitem_name\fR\fBmenu_item_name(3X)\fR
\fBitem_opts\fR\fBmenu_item_opts(3X)\fR
\fBitem_opts_off\fR\fBmenu_item_opts(3X)\fR
\fBitem_opts_on\fR\fBmenu_item_opts(3X)\fR
\fBitem_term\fR\fBmenu_hook(3X)\fR
\fBitem_userptr\fR\fBmenu_item_userptr(3X)\fR
\fBitem_value\fR\fBmenu_item_value(3X)\fR
\fBitem_visible\fR\fBmenu_item_visible(3X)\fR
\fBmenu_back\fR\fBmenu_attributes(3X)\fR
\fBmenu_driver\fR\fBmenu_driver(3X)\fR
\fBmenu_fore\fR\fBmenu_attributes(3X)\fR
\fBmenu_format\fR\fBmenu_format(3X)\fR
\fBmenu_grey\fR\fBmenu_attributes(3X)\fR
\fBmenu_init\fR\fBmenu_hook(3X)\fR
\fBmenu_items\fR\fBmenu_items(3X)\fR
\fBmenu_mark\fR\fBmenu_mark(3X)\fR
\fBmenu_opts\fR\fBmenu_opts(3X)\fR
\fBmenu_opts_off\fR\fBmenu_opts(3X)\fR
\fBmenu_opts_on\fR\fBmenu_opts(3X)\fR
\fBmenu_pad\fR\fBmenu_attributes(3X)\fR
\fBmenu_pattern\fR\fBmenu_pattern(3X)\fR
\fBmenu_sub\fR\fBmenu_win(3X)\fR
\fBmenu_term\fR\fBmenu_hook(3X)\fR
\fBmenu_userptr\fR\fBmenu_userptr(3X)\fR
\fBmenu_win\fR\fBmenu_win(3X)\fR
\fBnew_item\fR\fBmenu_item_new(3X)\fR
\fBnew_menu\fR\fBmenu_new(3X)\fR
\fBpos_menu_cursor\fR\fBmenu_cursor(3X)\fR
\fBpost_menu\fR\fBmenu_post(3X)\fR
\fBscale_menu\fR\fBmenu_win(3X)\fR
\fBset_current_item\fR\fBmenu_item_current(3X)\fR
\fBset_item_init\fR\fBmenu_hook(3X)\fR
\fBset_item_opts\fR\fBmenu_item_opts(3X)\fR
\fBset_item_term\fR\fBmenu_hook(3X)\fR
\fBset_item_userptr\fR\fBmenu_item_userptr(3X)\fR
\fBset_item_value\fR\fBmenu_item_value(3X)\fR
\fBset_menu_back\fR\fBmenu_attributes(3X)\fR
\fBset_menu_fore\fR\fBmenu_attributes(3X)\fR
\fBset_menu_format\fR\fBmenu_format(3X)\fR
\fBset_menu_grey\fR\fBmenu_attributes(3X)\fR
\fBset_menu_init\fR\fBmenu_hook(3X)\fR
\fBset_menu_items\fR\fBmenu_items(3X)\fR
\fBset_menu_mark\fR\fBmenu_mark(3X)\fR
\fBset_menu_opts\fR\fBmenu_opts(3X)\fR
\fBset_menu_pad\fR\fBmenu_attributes(3X)\fR
\fBset_menu_pattern\fR\fBmenu_pattern(3X)\fR
\fBset_menu_sub\fR\fBmenu_win(3X)\fR
\fBset_menu_term\fR\fBmenu_hook(3X)\fR
\fBset_menu_userptr\fR\fBmenu_userptr(3X)\fR
\fBset_menu_win\fR\fBmenu_win(3X)\fR
\fBset_top_row\fR\fBmenu_item_current(3X)\fR
\fBtop_row\fR\fBmenu_item_current(3X)\fR
\fBunpost_menu\fR\fBmenu_post(3X)\fR
.TE
.SH RETURN VALUES
.sp
.LP
Routines that return pointers always return \fINULL\fR on error. Routines that
return an integer return one of the following:
.sp
.ne 2
.mk
.na
\fB\fBE_OK\fR\fR
.ad
.RS 21n
.rt
The routine returned successfully.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_SYSTEM_ERROR\fR\fR
.ad
.RS 21n
.rt
System error.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_BAD_ARGUMENT\fR\fR
.ad
.RS 21n
.rt
An incorrect argument was passed to the routine.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_POSTED\fR\fR
.ad
.RS 21n
.rt
The menu is already posted.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_CONNECTED\fR\fR
.ad
.RS 21n
.rt
One or more items are already connected to another menu.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_BAD_STATE\fR\fR
.ad
.RS 21n
.rt
The routine was called from an initialization or termination function.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_NO_ROOM\fR\fR
.ad
.RS 21n
.rt
The menu does not fit within its subwindow.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_NOT_POSTED\fR\fR
.ad
.RS 21n
.rt
The menu has not been posted.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_UNKNOWN_COMMAND\fR\fR
.ad
.RS 21n
.rt
An unknown request was passed to the menu driver.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_NO_MATCH\fR\fR
.ad
.RS 21n
.rt
The character failed to match.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_NOT_SELECTABLE\fR\fR
.ad
.RS 21n
.rt
The item cannot be selected.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_NOT_CONNECTED\fR\fR
.ad
.RS 21n
.rt
No items are connected to the menu.
.RE
.sp
.ne 2
.mk
.na
\fB\fBE_REQUEST_DENIED\fR\fR
.ad
.RS 21n
.rt
The menu driver could not process the request.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
MT-LevelUnsafe
.TE
.SH SEE ALSO
.sp
.LP
\fBcurses\fR(3CURSES), \fBattributes\fR(5)
.SH NOTES
.sp
.LP
The header \fB<menu.h>\fR automatically includes the headers \fB<eti.h>\fR and
\fB<curses.h>\fR\&.
|