xref: /titanic_44/usr/src/man/man3curses/menus.3curses (revision 0956b730cfe26e3bfd5e8ed9c1527c0e3111b93c)
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]
menus 3CURSES "31 Dec 1996" "SunOS 5.11" "Curses Library Functions"
NAME
menus - character based menus package
SYNOPSIS

#include <menu.h>
DESCRIPTION

The menu library is built using the curses library, and any program using menus routines must call one of the curses initialization routines, such as initscr. A program using these routines must be compiled with -lmenu and -lcurses on the cc command line.

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.

"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 NULL item pointer. If an application changes a current default item attribute value, subsequent items created using new_item() will have the new default attribute value. The attributes of previously created items are not changed if a current default attribute value is changed.

"Routine Name Index"

The following table lists each menus routine and the name of the manual page on which it is described.

Menus Routine NameManual Page Name
current_itemmenu_item_current(3X)
free_itemmenu_item_new(3X)
free_menumenu_new(3X)
item_countmenu_items(3X)
item_descriptionmenu_item_name(3X)
item_indexmenu_item_current(3X)
item_initmenu_hook(3X)
item_namemenu_item_name(3X)
item_optsmenu_item_opts(3X)
item_opts_offmenu_item_opts(3X)
item_opts_onmenu_item_opts(3X)
item_termmenu_hook(3X)
item_userptrmenu_item_userptr(3X)
item_valuemenu_item_value(3X)
item_visiblemenu_item_visible(3X)
menu_backmenu_attributes(3X)
menu_drivermenu_driver(3X)
menu_foremenu_attributes(3X)
menu_formatmenu_format(3X)
menu_greymenu_attributes(3X)
menu_initmenu_hook(3X)
menu_itemsmenu_items(3X)
menu_markmenu_mark(3X)
menu_optsmenu_opts(3X)
menu_opts_offmenu_opts(3X)
menu_opts_onmenu_opts(3X)
menu_padmenu_attributes(3X)
menu_patternmenu_pattern(3X)
menu_submenu_win(3X)
menu_termmenu_hook(3X)
menu_userptrmenu_userptr(3X)
menu_winmenu_win(3X)
new_itemmenu_item_new(3X)
new_menumenu_new(3X)
pos_menu_cursormenu_cursor(3X)
post_menumenu_post(3X)
scale_menumenu_win(3X)
set_current_itemmenu_item_current(3X)
set_item_initmenu_hook(3X)
set_item_optsmenu_item_opts(3X)
set_item_termmenu_hook(3X)
set_item_userptrmenu_item_userptr(3X)
set_item_valuemenu_item_value(3X)
set_menu_backmenu_attributes(3X)
set_menu_foremenu_attributes(3X)
set_menu_formatmenu_format(3X)
set_menu_greymenu_attributes(3X)
set_menu_initmenu_hook(3X)
set_menu_itemsmenu_items(3X)
set_menu_markmenu_mark(3X)
set_menu_optsmenu_opts(3X)
set_menu_padmenu_attributes(3X)
set_menu_patternmenu_pattern(3X)
set_menu_submenu_win(3X)
set_menu_termmenu_hook(3X)
set_menu_userptrmenu_userptr(3X)
set_menu_winmenu_win(3X)
set_top_rowmenu_item_current(3X)
top_rowmenu_item_current(3X)
unpost_menumenu_post(3X)
RETURN VALUES

Routines that return pointers always return NULL on error. Routines that return an integer return one of the following:

E_OK

The routine returned successfully.

E_SYSTEM_ERROR

System error.

E_BAD_ARGUMENT

An incorrect argument was passed to the routine.

E_POSTED

The menu is already posted.

E_CONNECTED

One or more items are already connected to another menu.

E_BAD_STATE

The routine was called from an initialization or termination function.

E_NO_ROOM

The menu does not fit within its subwindow.

E_NOT_POSTED

The menu has not been posted.

E_UNKNOWN_COMMAND

An unknown request was passed to the menu driver.

E_NO_MATCH

The character failed to match.

E_NOT_SELECTABLE

The item cannot be selected.

E_NOT_CONNECTED

No items are connected to the menu.

E_REQUEST_DENIED

The menu driver could not process the request.

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelUnsafe
SEE ALSO

curses(3CURSES), attributes(5)

NOTES

The header <menu.h> automatically includes the headers <eti.h> and <curses.h>.