'\" 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
\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\fR automatically includes the headers \fB\fR and
\fB\fR\&.