Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

menu_item_value(3) [netbsd man page]

MENU_ITEM_VALUE(3)					   BSD Library Functions Manual 					MENU_ITEM_VALUE(3)

item_value, set_item_value, item_selected -- get or set value for an item LIBRARY
Curses Menu Library (libmenu, -lmenu) SYNOPSIS
#include <menu.h> int item_value(ITEM *item); int set_item_value(ITEM *item, int flag); int item_selected(MENU *menu, int **array); DESCRIPTION
The item_value() function returns value of the item. If the item has been selected then this value will be TRUE. The value can also be set by calling set_item_value() to set the value to a defined state. Setting the value to a value other than TRUE or FALSE will have undefined results. The item_selected() function returns the number of items that are selected in the menu, that is the number of items whose value is TRUE. The indexes of the selected items will be returned in array which will be dynamically allocated to hold the number of indexes. It is the responsibility of the caller to release this storage by calling free(3) when the storage is no longer required. If there are no elements selected in the items array then item_selected() will return 0 and array will be NULL. If an error occurs item_selected() will return one of the below return values which are less than 0. RETURN VALUES
The functions return one of the following error values: E_OK The function was successful. E_NOT_CONNECTED The item is not connected to a menu. E_REQUEST_DENIED The menu driver could not process the request. E_SYSTEM_ERROR A system error occurred whilst processing the request. SEE ALSO
curses(3), menus(3) NOTES
The header <menu.h> automatically includes both <curses.h> and <eti.h>. The function item_selected() is a NetBSD extension and must not be used in portable code. BSD
September 10, 1999 BSD

Check Out this Related Man Page

menu_item_value(3CURSES)				     Curses Library Functions					  menu_item_value(3CURSES)

menu_item_value, set_item_value, item_value - set and get menus item values SYNOPSIS
cc [ flag... ] file... -lmenu -lcurses [ library... ] #include <menu.h> int set_item_value(ITEM *item, int bool); int item_value(ITEM *item); DESCRIPTION
Unlike single-valued menus, multi-valued menus enable the end-user to select one or more items from a menu. set_item_value() sets the selected value of the item -- TRUE (selected) or FALSE (not selected). set_item_value() may be used only with multi-valued menus. To make a menu multi-valued, use set_menu_opts or menu_opts_off() to turn off the option O_ONEVALUE. (See menu_opts(3CURSES)). item_value() returns the select value of item, either TRUE (selected) or FALSE (unselected). RETURN VALUES
set_item_value() returns one of the following: E_OK The routine returned successfully. E_SYSTEM_ERROR System error. E_REQUEST_DENIED The menu driver could not process the request. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
curses(3CURSES), menus(3CURSES), menu_opts(3CURSES), attributes(5) NOTES
The header <menu.h> automatically includes the headers <eti.h> and <curses.h>. SunOS 5.11 31 Dec 1996 menu_item_value(3CURSES)
Man Page