DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
ETI menus

Manipulating an item's select value in a multi-valued menu

Select values of an item are either TRUE (selected) or FALSE (not selected). Function set_item_value sets the select value of an item, while item_value returns it.

SYNOPSIS

   int set_item_value (item, value)
   ITEM * item;
   int value;
   

int item_value (item) ITEM * item;

Function set_item_value fails if given an item that is not selectable (the O_SELECTABLE option was previously turned off) or the item is connected to a single-valued menu (connecting items to menus is described in ``Creating and freeing menus''). If successful, set_item_value returns E_OK. Otherwise, one of the following is returned.

E_SYSTEM_ERROR
system error

E_REQUEST_DENIED
item not selectable or single value menu
If the argument to item_value is an item pointer connected to a single-valued menu, item_value returns FALSE.

You might want to place the code in ``Using item_value in menu processing'' after your user responds to a menu. Function process_menu determines which items have been selected, processes them appropriately, and marks them as unselected to prepare for further user response.

   void process_menu (m) /* process multi-valued menu */
   MENU * m;
   {
   	ITEM ** i = menu_items (m);
   	
   	while (*i) {
   	{
   		if (item_value (*i)) {
   		{
   

/* take action appropriate for selection of this item */

set_item_value (*i, FALSE); } ++i; } }

Using item_value in menu processing


Next topic: Manipulating item attributes
Previous topic: Two kinds of menus: single- or multi-valued

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004