2 .\" Copyright 1989 AT&T
3 .\" Portions Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH MENU_ITEM_CURRENT 3CURSES "April 9, 2016"
9 menu_item_current, set_current_item, current_item, set_top_row, top_row,
10 item_index \- set and get current menus items
14 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lmenu\fR \fB -lcurses \fR [ \fIlibrary\fR... ]
17 \fBint\fR \fBset_current_item\fR(\fBMENU *\fR\fImenu\fR, \fBITEM *\fR\fIitem\fR);
22 \fBITEM *\fR\fBcurrent_item\fR(\fBMENU *\fR\fImenu\fR);
27 \fBint\fR \fBset_top_row\fR(\fBMENU *\fR\fImenu\fR, \fBint\fR \fIrow\fR);
32 \fBint\fR \fBtop_row\fR(\fBMENU *\fR\fImenu\fR);
37 \fBint\fR \fBitem_index\fR(\fBITEM *\fR\fIitem\fR);
42 The current item of a menu is the item where the cursor is currently
43 positioned. \fBset_current_item()\fR sets the current item of \fImenu\fR to
44 \fIitem\fR. \fBcurrent_item()\fR returns a pointer to the current item in
48 \fBset_top_row()\fR sets the top row of \fImenu\fR to \fIrow\fR. The left-most
49 item on the new top row becomes the current item. \fBtop_row()\fR returns the
50 number of the menu row currently displayed at the top of \fImenu\fR.
53 \fBitem_index()\fR returns the index to the \fIitem\fR in the item pointer
54 array. The value of this index ranges from \fB0\fR through \fIN\fR\fB-1\fR,
55 where \fIN\fR is the total number of items connected to the menu.
58 \fBcurrent_item()\fR returns \fBNULL\fR on error.
61 \fBtop_row()\fR and \fBindex_item()\fR return \fB\(mi1\fR on error.
64 \fBset_current_item()\fR and \fBset_top_row()\fR return one of the following:
71 The routine returned successfully.
89 An incorrect argument was passed to the routine.
98 The routine was called from an initialization or termination function.
104 \fBE_NOT_CONNECTED\fR
107 No items are connected to the menu.
112 See \fBattributes\fR(5) for descriptions of the following attributes:
120 ATTRIBUTE TYPE ATTRIBUTE VALUE
127 \fBcurses\fR(3CURSES), \fBmenus\fR(3CURSES), \fBattributes\fR(5)
130 The header \fB<menu.h>\fR automatically includes the headers \fB<eti.h>\fR and