'\"!  tbl | mmdoc
'\"macro stdmacro
.if n .pH g3x.menu_i_cur @(#)menu_i_cur	40.3 of 12/15/89
.\" Copyright 1989 AT&T
.\" ident	"@(#)svid_ti:ti_lib/menu_i_cur	1.4"
.nr X
.if \nX=0 .ds x} menu_item_current 3X "" "\&"
.if \nX=1 .ds x} menu_item_current 3X ""
.if \nX=2 .ds x} menu_item_current 3X "" "\&"
.if \nX=3 .ds x} menu_item_current "" "" "\&"
.TH \*(x}
.SH NAME
\f4menu_item_current\f2: \f4 set_current_item\f1, \f4current_item\f1, \f4set_top_row\f1, \f4top_row\f1, \f4item_index\f1 \- set and get current \f4menus\fP items
.SH SYNOPSIS
.nf
.ft 4
#include <menu.h>
.sp
int set_current_item(MENU *menu, ITEM *item);
ITEM *current_item(MENU *menu);
.sp 0.5
int set_top_row(MENU *menu, int row);
int top_row(MENU *menu);
.sp 0.5
int item_index(ITEM *item);
.ft 1
.fi
.SH DESCRIPTION
The current item of a menu is the item where the cursor is currently positioned.
\f4set_current_item\fP sets the current item of \f2menu\fP to \f2item\f1.
\f4current_item\fP returns a pointer to the the current item in
\f2menu\fP.
.PP
\f4set_top_row\fP sets the top row of \f2menu\f1 to \f2row\f1.
The left-most item on the new top row becomes the current item.
\f4top_row\fP returns the number 
of the menu row currently displayed at the top of \f2menu\fP.
.P
\f4item_index\f1 returns the index to the \f2item\f1 in the
item pointer array.
The value of this index ranges from \f40\f1 through \f2N\f4-1\f1,
where \f2N\f1 is the total number of items connected to the menu.
.SH RETURN VALUE
\f4current_item\fP returns \f4NULL\fP on error.
.P
\f4top_row\fP and \f4index_item\fP return \f4-1\fP on error.
.P
\f4set_current_item\fP and \f4set_top_row\fP
return one of the following:
.TS
lfCWw(1.25i)1 c1 l .
E_OK	\-	The routine returned successfully.
E_SYSTEM_ERROR	\-	System error.
E_BAD_ARGUMENT	\-	An incorrect argument was passed to the routine.
E_BAD_STATE	\-	T{
The routine was called from an initialization or termination function.
T}
E_NOT_CONNECTED	\-	No items are connected to the menu.
.TE
.RE
.SH NOTES
.PP
The header file \f4<menu.h>\f1 automatically includes the header files
\f4<eti.h>\fP and \f4<curses.h>\fP.
.SH SEE ALSO
.na
\f4curses\fP(3X),
\f4menus\fP(3X).
.ad
