Debian Codegraph @

upstream/debian-unstable/man3/menu.3menu

raw
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright 2018-2024,2025 Thomas E. Dickey *
4 .\" Copyright 1998-2014,2017 Free Software Foundation, Inc. *
5 .\" *
6 .\" Permission is hereby granted, free of charge, to any person obtaining a *
7 .\" copy of this software and associated documentation files (the *
8 .\" "Software"), to deal in the Software without restriction, including *
9 .\" without limitation the rights to use, copy, modify, merge, publish, *
10 .\" distribute, distribute with modifications, sublicense, and/or sell *
11 .\" copies of the Software, and to permit persons to whom the Software is *
12 .\" furnished to do so, subject to the following conditions: *
13 .\" *
14 .\" The above copyright notice and this permission notice shall be included *
15 .\" in all copies or substantial portions of the Software. *
16 .\" *
17 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
18 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
19 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
20 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
21 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
22 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
23 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
24 .\" *
25 .\" Except as contained in this notice, the name(s) of the above copyright *
26 .\" holders shall not be used in advertising or otherwise to promote the *
27 .\" sale, use or other dealings in this Software without prior written *
28 .\" authorization. *
29 .\"***************************************************************************
30 .\"
31 .\" $Id: menu.3x,v 1.54 2025/11/12 01:27:41 tom Exp $
32 .TH menu 3MENU 2025-11-11 "ncurses 6.6" "Library calls"
33 .ie \n(.g \{\
34 .ds `` \(lq
35 .ds '' \(rq
36 .\}
37 .el \{\
38 .ie t .ds `` ``
39 .el .ds `` ""
40 .ie t .ds '' ''
41 .el .ds '' ""
42 .\}
43 .
44 .de bP
45 .ie n .IP \(bu 4
46 .el .IP \(bu 2
47 ..
48 .SH NAME
49 \fBmenu\fP \-
50 present menus in \fIcurses\fP windows
51 .SH SYNOPSIS
52 .nf
53 \fB#include <menu.h>
54 .fi
55 .SH DESCRIPTION
56 The \fBmenu\fP library provides terminal-independent facilities for composing
57 menu systems on character-cell terminals.
58 The library includes: item routines,
59 which create and modify menu items; and menu routines, which group items into
60 menus, display menus on the screen, and handle interaction with the user.
61 .PP
62 The \fBmenu\fP library uses the \fBcurses\fP libraries, and a curses
63 initialization routine such as \fBinitscr\fP must be called before using any of
64 these functions.
65 To use the \fBmenu\fP library, link with the options
66 \fB\-lmenu \-lcurses\fP.
67 .
68 .SS "Current Default Values for Item Attributes"
69 .
70 The \fBmenu\fP library maintains a default value for item attributes.
71 You can
72 get or set this default by calling the appropriate \fBget_\fP or \fBset_\fP
73 routine with a
74 .I NULL
75 item pointer.
76 Changing this default with a
77 \fBset_\fP function affects future item creations, but does not change the
78 rendering of items already created.
79 .
80 .SS "Routine Name Index"
81 .
82 The following table lists each \fBmenu\fP routine and the name of
83 the manual page on which it is described.
84 .PP
85 .TS
86 L L.
87 \fBcurses\fP Routine Name Manual Page Name
88 _
89 current_item \fBmenu_current\fP(3MENU)
90 free_item \fBmenu_new\fP(3MENU)
91 free_menu \fBnew\fP(3MENU)
92 item_count \fBitems\fP(3MENU)
93 item_description \fBmenu_name\fP(3MENU)
94 item_index \fBmenu_current\fP(3MENU)
95 item_init \fBhook\fP(3MENU)
96 item_name \fBmenu_name\fP(3MENU)
97 item_opts \fBmenu_opts\fP(3MENU)
98 item_opts_off \fBmenu_opts\fP(3MENU)
99 item_opts_on \fBmenu_opts\fP(3MENU)
100 item_term \fBhook\fP(3MENU)
101 item_userptr \fBmenu_userptr\fP(3MENU)
102 item_value \fBmenu_value\fP(3MENU)
103 item_visible \fBmenu_visible\fP(3MENU)
104 menu_back \fBattributes\fP(3MENU)
105 menu_driver \fBdriver\fP(3MENU)
106 menu_fore \fBattributes\fP(3MENU)
107 menu_format \fBformat\fP(3MENU)
108 menu_grey \fBattributes\fP(3MENU)
109 menu_init \fBhook\fP(3MENU)
110 menu_items \fBitems\fP(3MENU)
111 menu_mark \fBmark\fP(3MENU)
112 menu_opts \fBopts\fP(3MENU)
113 menu_opts_off \fBopts\fP(3MENU)
114 menu_opts_on \fBopts\fP(3MENU)
115 menu_pad \fBattributes\fP(3MENU)
116 menu_pattern \fBpattern\fP(3MENU)
117 menu_request_by_name \fBrequestname\fP(3MENU)
118 menu_request_name \fBrequestname\fP(3MENU)
119 menu_spacing \fBspacing\fP(3MENU)
120 menu_sub \fBwin\fP(3MENU)
121 menu_term \fBhook\fP(3MENU)
122 menu_userptr \fBuserptr\fP(3MENU)
123 menu_win \fBwin\fP(3MENU)
124 new_item \fBmenu_new\fP(3MENU)
125 new_menu \fBnew\fP(3MENU)
126 pos_menu_cursor \fBcursor\fP(3MENU)
127 post_menu \fBpost\fP(3MENU)
128 scale_menu \fBwin\fP(3MENU)
129 set_current_item \fBmenu_current\fP(3MENU)
130 set_item_init \fBhook\fP(3MENU)
131 set_item_opts \fBmenu_opts\fP(3MENU)
132 set_item_term \fBhook\fP(3MENU)
133 set_item_userptr \fBmenu_userptr\fP(3MENU)
134 set_item_value \fBmenu_value\fP(3MENU)
135 set_menu_back \fBattributes\fP(3MENU)
136 set_menu_fore \fBattributes\fP(3MENU)
137 set_menu_format \fBformat\fP(3MENU)
138 set_menu_grey \fBattributes\fP(3MENU)
139 set_menu_init \fBhook\fP(3MENU)
140 set_menu_items \fBitems\fP(3MENU)
141 set_menu_mark \fBmark\fP(3MENU)
142 set_menu_opts \fBmenu_opts\fP(3MENU)
143 set_menu_pad \fBattributes\fP(3MENU)
144 set_menu_pattern \fBpattern\fP(3MENU)
145 set_menu_spacing \fBspacing\fP(3MENU)
146 set_menu_sub \fBwin\fP(3MENU)
147 set_menu_term \fBhook\fP(3MENU)
148 set_menu_userptr \fBuserptr\fP(3MENU)
149 set_menu_win \fBwin\fP(3MENU)
150 set_top_row \fBmenu_current\fP(3MENU)
151 top_row \fBmenu_current\fP(3MENU)
152 unpost_menu \fBpost\fP(3MENU)
153 .TE
154 .SH RETURN VALUE
155 Routines that return pointers return
156 .I NULL
157 on error.
158 Routines that return
159 an integer return one of the following error codes:
160 .TP 5
161 .B E_OK
162 The routine succeeded.
163 .TP 5
164 .B E_BAD_ARGUMENT
165 Routine detected an incorrect or out-of-range argument.
166 .TP 5
167 .B E_BAD_STATE
168 Routine was called from an initialization or termination function.
169 .TP 5
170 .B E_NO_MATCH
171 Character failed to match.
172 .TP 5
173 .B E_NO_ROOM
174 Menu is too large for its window.
175 .TP 5
176 .B E_NOT_CONNECTED
177 No items are connected to the menu.
178 .TP 5
179 .B E_NOT_POSTED
180 The menu has not been posted.
181 .TP 5
182 .B E_NOT_SELECTABLE
183 The designated item cannot be selected.
184 .TP 5
185 .B E_POSTED
186 The menu is already posted.
187 .TP 5
188 .B E_REQUEST_DENIED
189 The menu driver could not process the request.
190 .TP 5
191 .B E_SYSTEM_ERROR
192 System error occurred (see \fBerrno\fP(3)).
193 .TP 5
194 .B E_UNKNOWN_COMMAND
195 The menu driver code saw an unknown request code.
196 .SH NOTES
197 The header file \fI\%menu.h\fP itself includes the header file
198 \fI\%curses.h\fP.
199 .SH PORTABILITY
200 These routines emulate the System V menu library.
201 They were not supported on
202 Version 7 or BSD versions.
203 .PP
204 A menu facility was documented in SVr4.2's
205 \fICharacter User Interface Programming\fP document.
206 .PP
207 It is not part of X/Open Curses.
208 .PP
209 Aside from \fI\%ncurses\fP, there are few implementations:
210 .bP
211 systems based on SVr4 source code, e.g., Solaris.
212 .bP
213 NetBSD curses.
214 .SH AUTHORS
215 Juergen Pfeifer.
216 Manual pages and adaptation for \fI\%ncurses\fP by Eric S. Raymond.
217 .SH SEE ALSO
218 \fB\%ncurses\fP(3NCURSES) and related pages whose names begin \*(``menu_\*(''
219 for detailed descriptions of the entry points.