summaryrefslogtreecommitdiff
path: root/usr/src/man/man3curses/menus.3curses
blob: ddf9381ba8f33a863d1b38c7b91e655cb6611100 (plain)
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
'\" 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 "August 28, 2021"
.SH NAME
menus \- character based menus package
.SH SYNOPSIS
.nf
\fB#include <menu.h>\fR
.fi

.SH DESCRIPTION
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"
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"
The following table lists each menus routine and the name of the manual page on
which it is described.
.sp

.sp
.TS
c c
l l .
\fBMenus Routine Name\fR	\fBManual Page Name\fR
\fBcurrent_item\fR	\fBmenu_item_current(3CURSES)\fR
\fBfree_item\fR	\fBmenu_item_new(3CURSES)\fR
\fBfree_menu\fR	\fBmenu_new(3CURSES)\fR
\fBitem_count\fR	\fBmenu_items(3CURSES)\fR
\fBitem_description\fR	\fBmenu_item_name(3CURSES)\fR
\fBitem_index\fR	\fBmenu_item_current(3CURSES)\fR
\fBitem_init\fR	\fBmenu_hook(3CURSES)\fR
\fBitem_name\fR	\fBmenu_item_name(3CURSES)\fR
\fBitem_opts\fR	\fBmenu_item_opts(3CURSES)\fR
\fBitem_opts_off\fR	\fBmenu_item_opts(3CURSES)\fR
\fBitem_opts_on\fR	\fBmenu_item_opts(3CURSES)\fR
\fBitem_term\fR	\fBmenu_hook(3CURSES)\fR
\fBitem_userptr\fR	\fBmenu_item_userptr(3CURSES)\fR
\fBitem_value\fR	\fBmenu_item_value(3CURSES)\fR
\fBitem_visible\fR	\fBmenu_item_visible(3CURSES)\fR
\fBmenu_back\fR	\fBmenu_attributes(3CURSES)\fR
\fBmenu_driver\fR	\fBmenu_driver(3CURSES)\fR
\fBmenu_fore\fR	\fBmenu_attributes(3CURSES)\fR
\fBmenu_format\fR	\fBmenu_format(3CURSES)\fR
\fBmenu_grey\fR	\fBmenu_attributes(3CURSES)\fR
\fBmenu_init\fR	\fBmenu_hook(3CURSES)\fR
\fBmenu_items\fR	\fBmenu_items(3CURSES)\fR
\fBmenu_mark\fR	\fBmenu_mark(3CURSES)\fR
\fBmenu_opts\fR	\fBmenu_opts(3CURSES)\fR
\fBmenu_opts_off\fR	\fBmenu_opts(3CURSES)\fR
\fBmenu_opts_on\fR	\fBmenu_opts(3CURSES)\fR
\fBmenu_pad\fR	\fBmenu_attributes(3CURSES)\fR
\fBmenu_pattern\fR	\fBmenu_pattern(3CURSES)\fR
\fBmenu_sub\fR	\fBmenu_win(3CURSES)\fR
\fBmenu_term\fR	\fBmenu_hook(3CURSES)\fR
\fBmenu_userptr\fR	\fBmenu_userptr(3CURSES)\fR
\fBmenu_win\fR	\fBmenu_win(3CURSES)\fR
\fBnew_item\fR	\fBmenu_item_new(3CURSES)\fR
\fBnew_menu\fR	\fBmenu_new(3CURSES)\fR
\fBpos_menu_cursor\fR	\fBmenu_cursor(3CURSES)\fR
\fBpost_menu\fR	\fBmenu_post(3CURSES)\fR
\fBscale_menu\fR	\fBmenu_win(3CURSES)\fR
\fBset_current_item\fR	\fBmenu_item_current(3CURSES)\fR
\fBset_item_init\fR	\fBmenu_hook(3CURSES)\fR
\fBset_item_opts\fR	\fBmenu_item_opts(3CURSES)\fR
\fBset_item_term\fR	\fBmenu_hook(3CURSES)\fR
\fBset_item_userptr\fR	\fBmenu_item_userptr(3CURSES)\fR
\fBset_item_value\fR	\fBmenu_item_value(3CURSES)\fR
\fBset_menu_back\fR	\fBmenu_attributes(3CURSES)\fR
\fBset_menu_fore\fR	\fBmenu_attributes(3CURSES)\fR
\fBset_menu_format\fR	\fBmenu_format(3CURSES)\fR
\fBset_menu_grey\fR	\fBmenu_attributes(3CURSES)\fR
\fBset_menu_init\fR	\fBmenu_hook(3CURSES)\fR
\fBset_menu_items\fR	\fBmenu_items(3CURSES)\fR
\fBset_menu_mark\fR	\fBmenu_mark(3CURSES)\fR
\fBset_menu_opts\fR	\fBmenu_opts(3CURSES)\fR
\fBset_menu_pad\fR	\fBmenu_attributes(3CURSES)\fR
\fBset_menu_pattern\fR	\fBmenu_pattern(3CURSES)\fR
\fBset_menu_sub\fR	\fBmenu_win(3CURSES)\fR
\fBset_menu_term\fR	\fBmenu_hook(3CURSES)\fR
\fBset_menu_userptr\fR	\fBmenu_userptr(3CURSES)\fR
\fBset_menu_win\fR	\fBmenu_win(3CURSES)\fR
\fBset_top_row\fR	\fBmenu_item_current(3CURSES)\fR
\fBtop_row\fR	\fBmenu_item_current(3CURSES)\fR
\fBunpost_menu\fR	\fBmenu_post(3CURSES)\fR
.TE

.SH RETURN VALUES
Routines that return pointers always return \fINULL\fR on error. Routines that
return an integer return one of the following:
.sp
.ne 2
.na
\fB\fBE_OK\fR\fR
.ad
.RS 21n
The routine returned successfully.
.RE

.sp
.ne 2
.na
\fB\fBE_SYSTEM_ERROR\fR\fR
.ad
.RS 21n
System error.
.RE

.sp
.ne 2
.na
\fB\fBE_BAD_ARGUMENT\fR\fR
.ad
.RS 21n
An incorrect argument was passed to the routine.
.RE

.sp
.ne 2
.na
\fB\fBE_POSTED\fR\fR
.ad
.RS 21n
The menu is already posted.
.RE

.sp
.ne 2
.na
\fB\fBE_CONNECTED\fR\fR
.ad
.RS 21n
One or more items are already connected to another menu.
.RE

.sp
.ne 2
.na
\fB\fBE_BAD_STATE\fR\fR
.ad
.RS 21n
The routine was called from an initialization or termination function.
.RE

.sp
.ne 2
.na
\fB\fBE_NO_ROOM\fR\fR
.ad
.RS 21n
The menu does not fit within its subwindow.
.RE

.sp
.ne 2
.na
\fB\fBE_NOT_POSTED\fR\fR
.ad
.RS 21n
The menu has not been posted.
.RE

.sp
.ne 2
.na
\fB\fBE_UNKNOWN_COMMAND\fR\fR
.ad
.RS 21n
An unknown request was passed to the menu driver.
.RE

.sp
.ne 2
.na
\fB\fBE_NO_MATCH\fR\fR
.ad
.RS 21n
The character failed to match.
.RE

.sp
.ne 2
.na
\fB\fBE_NOT_SELECTABLE\fR\fR
.ad
.RS 21n
The item cannot be selected.
.RE

.sp
.ne 2
.na
\fB\fBE_NOT_CONNECTED\fR\fR
.ad
.RS 21n
No items are connected to the menu.
.RE

.sp
.ne 2
.na
\fB\fBE_REQUEST_DENIED\fR\fR
.ad
.RS 21n
The menu driver could not process the request.
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
MT-Level	Unsafe
.TE

.SH SEE ALSO
.BR curses (3CURSES),
.BR attributes (7)
.SH NOTES
The header \fB<menu.h>\fR automatically includes the headers  \fB<eti.h>\fR and
\fB<curses.h>\fR\&.