source: trunk/ncurses/man/mitem_current.3x@ 2787

Last change on this file since 2787 was 2621, checked in by bird, 19 years ago

GNU ncurses 5.5

File size: 4.3 KB
Line 
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.TH mitem_current 3X ""
32.SH NAME
33\fBmitem_current\fR - set and get current_menu_item
34.SH SYNOPSIS
35\fB#include <menu.h>\fR
36.br
37int set_current_item(MENU *menu, const ITEM *item);
38.br
39ITEM *current_item(const MENU *menu);
40.br
41int set_top_row(MENU *menu, int row);
42.br
43int top_row(const MENU *menu);
44.br
45int item_index(const ITEM *item);
46.br
47.SH DESCRIPTION
48The function \fBset_current_item\fR sets the current item (the item on which
49the menu cursor is positioned). \fBcurrent_item\fR returns a pointer to the
50current item in the given menu.
51
52The function \fBset_top_row\fR sets the top row of the menu to show the given
53row (the top row is initially 0, and is reset to this value whenever the
54\fBO_ROWMAJOR\fR option is toggled). The item leftmost on the given row
55becomes current. The function \fBtop_row\fR returns the number of the top menu
56row being displayed.
57
58The function \fBitem_index\fR returns the (zero-origin) index of \fIitem\fR in
59the menu's item pointer list.
60.SH RETURN VALUE
61\fBcurrent_item\fR returns \fBNULL\fR on error.
62
63\fBtop_row\fR and \fBitem_index\fR return \fBERR\fR (the general \fBcurses\fR
64error value) on error.
65
66\fBset_current_item\fR and \fBset_top_row\fR return one of the following:
67.TP 5
68\fBE_OK\fR
69The routine succeeded.
70.TP 5
71\fBE_SYSTEM_ERROR\fR
72System error occurred (see \fBerrno\fR).
73.TP 5
74\fBE_BAD_ARGUMENT\fR
75Routine detected an incorrect or out-of-range argument.
76.TP 5
77\fBE_BAD_STATE\fR
78Routine was called from an initialization or termination function.
79.TP 5
80\fBE_NOT_CONNECTED\fR
81No items are connected to the menu.
82.SH SEE ALSO
83\fBcurses\fR(3X), \fBmenu\fR(3X).
84.SH NOTES
85The header file \fB<menu.h>\fR automatically includes the header file
86\fB<curses.h>\fR.
87.SH PORTABILITY
88These routines emulate the System V menu library. They were not supported on
89Version 7 or BSD versions.
90
91The SVr4 menu library documentation specifies the \fBtop_row\fR and
92\fBindex_item\fR error value as -1 (which is the value of \fBERR\fR).
93.SH AUTHORS
94Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
95S. Raymond.
96.\"#
97.\"# The following sets edit modes for GNU EMACS
98.\"# Local Variables:
99.\"# mode:nroff
100.\"# fill-column:79
101.\"# End:
Note: See TracBrowser for help on using the repository browser.