2 .TH mitem_current 3X ""
4 \fBmitem_current\fR - set and get current_menu_item
6 \fB#include <menu.h>\fR
8 int set_current_item(MENU *menu, const ITEM *item);
10 ITEM *current_item(const MENU *menu);
12 int set_top_row(MENU *menu, int row);
14 int top_row(const MENU *menu);
16 int item_index(const ITEM *item);
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.
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
29 The function \fBitem_index\fR returns the (zero-origin) index of \fIitem\fR in
30 the menu's item pointer list.
32 \fBcurrent_item\fR returns \fBNULL\fR on error.
34 \fBtop_row\fR and \fBitem_index\fR return \fBERR\fR (the general \fBcurses\fB
35 error value) on error.
37 \fBset_current_item\fR and \fBset_top_row\fR return one of the following:
40 The routine succeeded.
43 System error occurred (see \fBerrno\fR).
46 Routine detected an incorrect or out-of-range argument.
49 Routine was called from an initialization or termination function.
52 No items are connected to the menu.
54 \fBcurses\fR(3X), \fBmenu\fR(3X).
56 The header file \fB<menu.h>\fR automatically includes the header file
59 These routines emulate the System V menu library. They were not supported on
60 Version 7 or BSD versions.
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).
65 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
68 .\"# The following sets edit modes for GNU EMACS