blob: a833c3b55123587d63784bf4800b82f98b325aa4 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301'\" t
2.\"***************************************************************************
micky3879b9f5e72025-07-08 18:04:53 -04003.\" Copyright 2018-2023,2024 Thomas E. Dickey *
4.\" Copyright 1998-2014,2017 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05305.\" *
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.\"
micky3879b9f5e72025-07-08 18:04:53 -040031.\" $Id: menu.3x,v 1.45 2024/03/16 15:35:01 tom Exp $
32.TH menu 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "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..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053048.SH NAME
micky3879b9f5e72025-07-08 18:04:53 -040049\fBmenu\fP \-
50curses extension for programming menus
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053051.SH SYNOPSIS
micky3879b9f5e72025-07-08 18:04:53 -040052.nf
53\fB#include <menu.h>
54.fi
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055.SH DESCRIPTION
micky3879b9f5e72025-07-08 18:04:53 -040056The \fBmenu\fP library provides terminal-independent facilities for composing
57menu systems on character-cell terminals.
58The library includes: item routines,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059which create and modify menu items; and menu routines, which group items into
60menus, display menus on the screen, and handle interaction with the user.
61.PP
micky3879b9f5e72025-07-08 18:04:53 -040062The \fBmenu\fP library uses the \fBcurses\fP libraries, and a curses
63initialization routine such as \fBinitscr\fP must be called before using any of
64these functions.
65To use the \fBmenu\fP library, link with the options
66\fB\-lmenu \-lcurses\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053067.
micky3879b9f5e72025-07-08 18:04:53 -040068.SS "Current Default Values for Item Attributes"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053069.
micky3879b9f5e72025-07-08 18:04:53 -040070The \fBmenu\fP library maintains a default value for item attributes.
71You can
72get or set this default by calling the appropriate \fBget_\fP or \fBset_\fP
73routine with a \fBNULL\fP item pointer.
74Changing this default with a
75\fBset_\fP function affects future item creations, but does not change the
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053076rendering of items already created.
77.
micky3879b9f5e72025-07-08 18:04:53 -040078.SS "Routine Name Index"
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053079.
micky3879b9f5e72025-07-08 18:04:53 -040080The following table lists each \fBmenu\fP routine and the name of
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053081the manual page on which it is described.
micky3879b9f5e72025-07-08 18:04:53 -040082.PP
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053083.TS
84l l .
micky3879b9f5e72025-07-08 18:04:53 -040085\fBcurses\fP Routine Name Manual Page Name
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053086=
micky3879b9f5e72025-07-08 18:04:53 -040087current_item \fBmitem_current\fP(3X)
88free_item \fBmitem_new\fP(3X)
89free_menu \fBmenu_new\fP(3X)
90item_count \fBmenu_items\fP(3X)
91item_description \fBmitem_name\fP(3X)
92item_index \fBmitem_current\fP(3X)
93item_init \fBmenu_hook\fP(3X)
94item_name \fBmitem_name\fP(3X)
95item_opts \fBmitem_opts\fP(3X)
96item_opts_off \fBmitem_opts\fP(3X)
97item_opts_on \fBmitem_opts\fP(3X)
98item_term \fBmenu_hook\fP(3X)
99item_userptr \fBmitem_userptr\fP(3X)
100item_value \fBmitem_value\fP(3X)
101item_visible \fBmitem_visible\fP(3X)
102menu_back \fBmenu_attributes\fP(3X)
103menu_driver \fBmenu_driver\fP(3X)
104menu_fore \fBmenu_attributes\fP(3X)
105menu_format \fBmenu_format\fP(3X)
106menu_grey \fBmenu_attributes\fP(3X)
107menu_init \fBmenu_hook\fP(3X)
108menu_items \fBmenu_items\fP(3X)
109menu_mark \fBmenu_mark\fP(3X)
110menu_opts \fBmenu_opts\fP(3X)
111menu_opts_off \fBmenu_opts\fP(3X)
112menu_opts_on \fBmenu_opts\fP(3X)
113menu_pad \fBmenu_attributes\fP(3X)
114menu_pattern \fBmenu_pattern\fP(3X)
115menu_request_by_name \fBmenu_requestname\fP(3X)
116menu_request_name \fBmenu_requestname\fP(3X)
117menu_spacing \fBmenu_spacing\fP(3X)
118menu_sub \fBmenu_win\fP(3X)
119menu_term \fBmenu_hook\fP(3X)
120menu_userptr \fBmenu_userptr\fP(3X)
121menu_win \fBmenu_win\fP(3X)
122new_item \fBmitem_new\fP(3X)
123new_menu \fBmenu_new\fP(3X)
124pos_menu_cursor \fBmenu_cursor\fP(3X)
125post_menu \fBmenu_post\fP(3X)
126scale_menu \fBmenu_win\fP(3X)
127set_current_item \fBmitem_current\fP(3X)
128set_item_init \fBmenu_hook\fP(3X)
129set_item_opts \fBmitem_opts\fP(3X)
130set_item_term \fBmenu_hook\fP(3X)
131set_item_userptr \fBmitem_userptr\fP(3X)
132set_item_value \fBmitem_value\fP(3X)
133set_menu_back \fBmenu_attributes\fP(3X)
134set_menu_fore \fBmenu_attributes\fP(3X)
135set_menu_format \fBmenu_format\fP(3X)
136set_menu_grey \fBmenu_attributes\fP(3X)
137set_menu_init \fBmenu_hook\fP(3X)
138set_menu_items \fBmenu_items\fP(3X)
139set_menu_mark \fBmenu_mark\fP(3X)
140set_menu_opts \fBmitem_opts\fP(3X)
141set_menu_pad \fBmenu_attributes\fP(3X)
142set_menu_pattern \fBmenu_pattern\fP(3X)
143set_menu_spacing \fBmenu_spacing\fP(3X)
144set_menu_sub \fBmenu_win\fP(3X)
145set_menu_term \fBmenu_hook\fP(3X)
146set_menu_userptr \fBmenu_userptr\fP(3X)
147set_menu_win \fBmenu_win\fP(3X)
148set_top_row \fBmitem_current\fP(3X)
149top_row \fBmitem_current\fP(3X)
150unpost_menu \fBmenu_post\fP(3X)
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530151.TE
152.SH RETURN VALUE
micky3879b9f5e72025-07-08 18:04:53 -0400153Routines that return pointers return \fBNULL\fP on error.
154Routines that return
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530155an integer return one of the following error codes:
156.TP 5
157.B E_OK
158The routine succeeded.
159.TP 5
160.B E_BAD_ARGUMENT
161Routine detected an incorrect or out-of-range argument.
162.TP 5
163.B E_BAD_STATE
164Routine was called from an initialization or termination function.
165.TP 5
166.B E_NO_MATCH
167Character failed to match.
168.TP 5
169.B E_NO_ROOM
170Menu is too large for its window.
171.TP 5
172.B E_NOT_CONNECTED
173No items are connected to the menu.
174.TP 5
175.B E_NOT_POSTED
176The menu has not been posted.
177.TP 5
178.B E_NOT_SELECTABLE
179The designated item cannot be selected.
180.TP 5
181.B E_POSTED
182The menu is already posted.
183.TP 5
184.B E_REQUEST_DENIED
185The menu driver could not process the request.
186.TP 5
187.B E_SYSTEM_ERROR
micky3879b9f5e72025-07-08 18:04:53 -0400188System error occurred (see \fBerrno\fP(3)).
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530189.TP 5
190.B E_UNKNOWN_COMMAND
191The menu driver code saw an unknown request code.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530192.SH NOTES
micky3879b9f5e72025-07-08 18:04:53 -0400193The header file \fI\%menu.h\fP itself includes the header file
194\fI\%curses.h\fP.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530195.SH PORTABILITY
micky3879b9f5e72025-07-08 18:04:53 -0400196These routines emulate the System V menu library.
197They were not supported on
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530198Version 7 or BSD versions.
Steve Kondikae271bc2015-11-15 02:50:53 +0100199.PP
micky3879b9f5e72025-07-08 18:04:53 -0400200A menu facility was documented in SVr4.2's
201\fICharacter User Interface Programming\fP document.
202.PP
203It is not part of X/Open Curses.
204.PP
205Aside from \fI\%ncurses\fP, there are few implementations:
206.bP
207systems based on SVr4 source code, e.g., Solaris.
208.bP
209NetBSD curses.
210.SH AUTHORS
211Juergen Pfeifer.
212Manual pages and adaptation for \fI\%ncurses\fP by Eric S. Raymond.
213.SH SEE ALSO
214\fB\%curses\fP(3X) and related pages whose names begin \*(``menu_\*(''
215for detailed descriptions of the entry points.