]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/mitem_current.3x
ncurses 4.1
[ncurses.git] / man / mitem_current.3x
1 '\" t
2 .TH mitem_current 3X ""
3 .SH NAME
4 \fBmitem_current\fR - set and get current_menu_item
5 .SH SYNOPSIS
6 \fB#include <menu.h>\fR
7 .br
8 int set_current_item(MENU *menu, const ITEM *item);
9 .br
10 ITEM *current_item(const MENU *menu);
11 .br
12 int set_top_row(MENU *menu, int row);
13 .br
14 int top_row(const MENU *menu);
15 .br
16 int item_index(const ITEM *item);
17 .br
18 .SH DESCRIPTION
19 The function \fBset_current_item\fR sets the current item (the item on which
20 the menu cursor is positioned).  \fBcurrent_item\fR returns a pointer to the
21 current item in the given menu.
22
23 The function \fBset_top_row\fR sets the top row of the menu to show the given
24 row (the top row is initially 0, and is reset to this value whenever the
25 \fBO_ROWMAJOR\fR option is toggled).  The item leftmost on the given row
26 becomes current.  The function \fBtop_row\fR returns the number of the top menu
27 row being displayed.
28
29 The function \fBitem_index\fR returns the (zero-origin) index of \fIitem\fR in
30 the menu's item pointer list.
31 .SH RETURN VALUE
32 \fBcurrent_item\fR returns \fBNULL\fR on error.
33
34 \fBtop_row\fR and \fBitem_index\fR return \fBERR\fR (the general \fBcurses\fB 
35 error value) on error.
36
37 \fBset_current_item\fR and \fBset_top_row\fR return one of the following:
38 .TP 5
39 \fBE_OK\fR
40 The routine succeeded.
41 .TP 5
42 \fBE_SYSTEM_ERROR\fR
43 System error occurred (see \fBerrno\fR).
44 .TP 5
45 \fBE_BAD_ARGUMENT\fR
46 Routine detected an incorrect or out-of-range argument.
47 .TP 5
48 \fBE_BAD_STATE\fR
49 Routine was called from an initialization or termination function.
50 .TP 5
51 \fBE_NOT_CONNECTED\fR
52 No items are connected to the menu.
53 .SH SEE ALSO
54 \fBcurses\fR(3X), \fBmenu\fR(3X).
55 .SH NOTES
56 The header file \fB<menu.h>\fR automatically includes the header file
57 \fB<curses.h>\fR.
58 .SH PORTABILITY
59 These routines emulate the System V menu library.  They were not supported on
60 Version 7 or BSD versions.
61
62 The SVr4 menu library documentation specifies the \fBtop_row\fR and
63 \fBindex_item\fR error value as -1 (which is the value of \fBERR\fR).
64 .SH AUTHORS
65 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
66 S. Raymond.
67 .\"#
68 .\"# The following sets edit modes for GNU EMACS
69 .\"# Local Variables:
70 .\"# mode:nroff
71 .\"# fill-column:79
72 .\"# End: