8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / man / man3curses / menu_item_current.3curses
blob253ef03e315272b5dc1e96c4640d070e816330bd
1 '\" te
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"
8 .SH NAME
9 menu_item_current, set_current_item, current_item, set_top_row, top_row,
10 item_index \- set and get current menus items
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lmenu\fR \fB -lcurses \fR [ \fIlibrary\fR... ]
15 #include <menu.h>
17 \fBint\fR \fBset_current_item\fR(\fBMENU *\fR\fImenu\fR, \fBITEM *\fR\fIitem\fR);
18 .fi
20 .LP
21 .nf
22 \fBITEM *\fR\fBcurrent_item\fR(\fBMENU *\fR\fImenu\fR);
23 .fi
25 .LP
26 .nf
27 \fBint\fR \fBset_top_row\fR(\fBMENU *\fR\fImenu\fR, \fBint\fR \fIrow\fR);
28 .fi
30 .LP
31 .nf
32 \fBint\fR \fBtop_row\fR(\fBMENU *\fR\fImenu\fR);
33 .fi
35 .LP
36 .nf
37 \fBint\fR \fBitem_index\fR(\fBITEM *\fR\fIitem\fR);
38 .fi
40 .SH DESCRIPTION
41 .LP
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
45 \fImenu\fR.
46 .sp
47 .LP
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.
51 .sp
52 .LP
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.
56 .SH RETURN VALUES
57 .LP
58 \fBcurrent_item()\fR returns \fBNULL\fR on error.
59 .sp
60 .LP
61 \fBtop_row()\fR and \fBindex_item()\fR return \fB\(mi1\fR on error.
62 .sp
63 .LP
64 \fBset_current_item()\fR and \fBset_top_row()\fR return one of the following:
65 .sp
66 .ne 2
67 .na
68 \fBE_OK\fR
69 .ad
70 .RS 19n
71 The routine returned successfully.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fBE_SYSTEM_ERROR\fR
78 .ad
79 .RS 19n
80 System error.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fBE_BAD_ARGUMENT\fR
87 .ad
88 .RS 19n
89 An incorrect argument was passed to the routine.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fBE_BAD_STATE\fR
96 .ad
97 .RS 19n
98 The routine was called from an initialization or termination function.
99 .RE
102 .ne 2
104 \fBE_NOT_CONNECTED\fR
106 .RS 19n
107 No items are connected to the menu.
110 .SH ATTRIBUTES
112 See \fBattributes\fR(5) for descriptions of the following attributes:
117 box;
118 c | c
119 l | l .
120 ATTRIBUTE TYPE  ATTRIBUTE VALUE
122 MT-Level        Unsafe
125 .SH SEE ALSO
127 \fBcurses\fR(3CURSES), \fBmenus\fR(3CURSES), \fBattributes\fR(5)
128 .SH NOTES
130 The header \fB<menu.h>\fR automatically includes the headers  \fB<eti.h>\fR and
131 \fB<curses.h>\fR\&.