Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / mitem_current.3
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998 Free Software Foundation, Inc.                        *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: mitem_current.3x,v 1.9 1998/12/26 19:52:34 tom Exp $
31 .\" $DragonFly: src/lib/libncurses/man/mitem_current.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
32 .TH mitem_current 3X ""
33 .SH NAME
34 \fBmitem_current\fR - set and get current_menu_item
35 .SH SYNOPSIS
36 \fB#include <menu.h>\fR
37 .br
38 int set_current_item(MENU *menu, const ITEM *item);
39 .br
40 ITEM *current_item(const MENU *menu);
41 .br
42 int set_top_row(MENU *menu, int row);
43 .br
44 int top_row(const MENU *menu);
45 .br
46 int item_index(const ITEM *item);
47 .br
48 .SH DESCRIPTION
49 The function \fBset_current_item\fR sets the current item (the item on which
50 the menu cursor is positioned).  \fBcurrent_item\fR returns a pointer to the
51 current item in the given menu.
52
53 The function \fBset_top_row\fR sets the top row of the menu to show the given
54 row (the top row is initially 0, and is reset to this value whenever the
55 \fBO_ROWMAJOR\fR option is toggled).  The item leftmost on the given row
56 becomes current.  The function \fBtop_row\fR returns the number of the top menu
57 row being displayed.
58
59 The function \fBitem_index\fR returns the (zero-origin) index of \fIitem\fR in
60 the menu's item pointer list.
61 .SH RETURN VALUE
62 \fBcurrent_item\fR returns \fBNULL\fR on error.
63
64 \fBtop_row\fR and \fBitem_index\fR return \fBERR\fR (the general \fBcurses\fR
65 error value) on error.
66
67 \fBset_current_item\fR and \fBset_top_row\fR return one of the following:
68 .TP 5
69 \fBE_OK\fR
70 The routine succeeded.
71 .TP 5
72 \fBE_SYSTEM_ERROR\fR
73 System error occurred (see \fBerrno\fR).
74 .TP 5
75 \fBE_BAD_ARGUMENT\fR
76 Routine detected an incorrect or out-of-range argument.
77 .TP 5
78 \fBE_BAD_STATE\fR
79 Routine was called from an initialization or termination function.
80 .TP 5
81 \fBE_NOT_CONNECTED\fR
82 No items are connected to the menu.
83 .SH SEE ALSO
84 \fBcurses\fR(3X), \fBmenu\fR(3X).
85 .SH NOTES
86 The header file \fB<menu.h>\fR automatically includes the header file
87 \fB<curses.h>\fR.
88 .SH PORTABILITY
89 These routines emulate the System V menu library.  They were not supported on
90 Version 7 or BSD versions.
91
92 The SVr4 menu library documentation specifies the \fBtop_row\fR and
93 \fBindex_item\fR error value as -1 (which is the value of \fBERR\fR).
94 .SH AUTHORS
95 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
96 S. Raymond.
97 .\"#
98 .\"# The following sets edit modes for GNU EMACS
99 .\"# Local Variables:
100 .\"# mode:nroff
101 .\"# fill-column:79
102 .\"# End: