2 .\" Copyright 1989 AT&T
3 .\" Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH MENUS 3CURSES "Dec 31, 1996"
9 menus \- character based menus package
13 \fB#include <menu.h>\fR
19 The \fBmenu\fR library is built using the \fBcurses\fR library, and any program
20 using menus routines must call one of the \fBcurses\fR initialization routines,
21 such as \fBinitscr\fR. A program using these routines must be compiled with
22 \fB-lmenu\fR and \fB-lcurses\fR on the \fBcc\fR command line.
25 The menus package gives the applications programmer a terminal-independent
26 method of creating and customizing menus for user interaction. The menus
27 package includes: item routines, which are used to create and customize menu
28 items; and menu routines, which are used to create and customize menus, assign
29 pre- and post-processing routines, and display and interact with menus.
30 .SS "Current Default Values for Item Attributes"
33 The menus package establishes initial current default values for item
34 attributes. During item initialization, each item attribute is assigned the
35 current default value for that attribute. An application can change or retrieve
36 a current default attribute value by calling the appropriate set or retrieve
37 routine with a \fINULL\fR item pointer. If an application changes a current
38 default item attribute value, subsequent items created using \fBnew_item()\fR
39 will have the new default attribute value. The attributes of previously created
40 items are not changed if a current default attribute value is changed.
41 .SS "Routine Name Index"
44 The following table lists each menus routine and the name of the manual page on
45 which it is described.
52 \fBMenus Routine Name\fR \fBManual Page Name\fR
53 \fBcurrent_item\fR \fBmenu_item_current(3X)\fR
54 \fBfree_item\fR \fBmenu_item_new(3X)\fR
55 \fBfree_menu\fR \fBmenu_new(3X)\fR
56 \fBitem_count\fR \fBmenu_items(3X)\fR
57 \fBitem_description\fR \fBmenu_item_name(3X)\fR
58 \fBitem_index\fR \fBmenu_item_current(3X)\fR
59 \fBitem_init\fR \fBmenu_hook(3X)\fR
60 \fBitem_name\fR \fBmenu_item_name(3X)\fR
61 \fBitem_opts\fR \fBmenu_item_opts(3X)\fR
62 \fBitem_opts_off\fR \fBmenu_item_opts(3X)\fR
63 \fBitem_opts_on\fR \fBmenu_item_opts(3X)\fR
64 \fBitem_term\fR \fBmenu_hook(3X)\fR
65 \fBitem_userptr\fR \fBmenu_item_userptr(3X)\fR
66 \fBitem_value\fR \fBmenu_item_value(3X)\fR
67 \fBitem_visible\fR \fBmenu_item_visible(3X)\fR
68 \fBmenu_back\fR \fBmenu_attributes(3X)\fR
69 \fBmenu_driver\fR \fBmenu_driver(3X)\fR
70 \fBmenu_fore\fR \fBmenu_attributes(3X)\fR
71 \fBmenu_format\fR \fBmenu_format(3X)\fR
72 \fBmenu_grey\fR \fBmenu_attributes(3X)\fR
73 \fBmenu_init\fR \fBmenu_hook(3X)\fR
74 \fBmenu_items\fR \fBmenu_items(3X)\fR
75 \fBmenu_mark\fR \fBmenu_mark(3X)\fR
76 \fBmenu_opts\fR \fBmenu_opts(3X)\fR
77 \fBmenu_opts_off\fR \fBmenu_opts(3X)\fR
78 \fBmenu_opts_on\fR \fBmenu_opts(3X)\fR
79 \fBmenu_pad\fR \fBmenu_attributes(3X)\fR
80 \fBmenu_pattern\fR \fBmenu_pattern(3X)\fR
81 \fBmenu_sub\fR \fBmenu_win(3X)\fR
82 \fBmenu_term\fR \fBmenu_hook(3X)\fR
83 \fBmenu_userptr\fR \fBmenu_userptr(3X)\fR
84 \fBmenu_win\fR \fBmenu_win(3X)\fR
85 \fBnew_item\fR \fBmenu_item_new(3X)\fR
86 \fBnew_menu\fR \fBmenu_new(3X)\fR
87 \fBpos_menu_cursor\fR \fBmenu_cursor(3X)\fR
88 \fBpost_menu\fR \fBmenu_post(3X)\fR
89 \fBscale_menu\fR \fBmenu_win(3X)\fR
90 \fBset_current_item\fR \fBmenu_item_current(3X)\fR
91 \fBset_item_init\fR \fBmenu_hook(3X)\fR
92 \fBset_item_opts\fR \fBmenu_item_opts(3X)\fR
93 \fBset_item_term\fR \fBmenu_hook(3X)\fR
94 \fBset_item_userptr\fR \fBmenu_item_userptr(3X)\fR
95 \fBset_item_value\fR \fBmenu_item_value(3X)\fR
96 \fBset_menu_back\fR \fBmenu_attributes(3X)\fR
97 \fBset_menu_fore\fR \fBmenu_attributes(3X)\fR
98 \fBset_menu_format\fR \fBmenu_format(3X)\fR
99 \fBset_menu_grey\fR \fBmenu_attributes(3X)\fR
100 \fBset_menu_init\fR \fBmenu_hook(3X)\fR
101 \fBset_menu_items\fR \fBmenu_items(3X)\fR
102 \fBset_menu_mark\fR \fBmenu_mark(3X)\fR
103 \fBset_menu_opts\fR \fBmenu_opts(3X)\fR
104 \fBset_menu_pad\fR \fBmenu_attributes(3X)\fR
105 \fBset_menu_pattern\fR \fBmenu_pattern(3X)\fR
106 \fBset_menu_sub\fR \fBmenu_win(3X)\fR
107 \fBset_menu_term\fR \fBmenu_hook(3X)\fR
108 \fBset_menu_userptr\fR \fBmenu_userptr(3X)\fR
109 \fBset_menu_win\fR \fBmenu_win(3X)\fR
110 \fBset_top_row\fR \fBmenu_item_current(3X)\fR
111 \fBtop_row\fR \fBmenu_item_current(3X)\fR
112 \fBunpost_menu\fR \fBmenu_post(3X)\fR
118 Routines that return pointers always return \fINULL\fR on error. Routines that
119 return an integer return one of the following:
126 The routine returned successfully.
132 \fB\fBE_SYSTEM_ERROR\fR\fR
141 \fB\fBE_BAD_ARGUMENT\fR\fR
144 An incorrect argument was passed to the routine.
153 The menu is already posted.
159 \fB\fBE_CONNECTED\fR\fR
162 One or more items are already connected to another menu.
168 \fB\fBE_BAD_STATE\fR\fR
171 The routine was called from an initialization or termination function.
177 \fB\fBE_NO_ROOM\fR\fR
180 The menu does not fit within its subwindow.
186 \fB\fBE_NOT_POSTED\fR\fR
189 The menu has not been posted.
195 \fB\fBE_UNKNOWN_COMMAND\fR\fR
198 An unknown request was passed to the menu driver.
204 \fB\fBE_NO_MATCH\fR\fR
207 The character failed to match.
213 \fB\fBE_NOT_SELECTABLE\fR\fR
216 The item cannot be selected.
222 \fB\fBE_NOT_CONNECTED\fR\fR
225 No items are connected to the menu.
231 \fB\fBE_REQUEST_DENIED\fR\fR
234 The menu driver could not process the request.
240 See \fBattributes\fR(5) for descriptions of the following attributes:
248 ATTRIBUTE TYPE ATTRIBUTE VALUE
256 \fBcurses\fR(3CURSES), \fBattributes\fR(5)
260 The header \fB<menu.h>\fR automatically includes the headers \fB<eti.h>\fR and