4 <!-- Manpage converted by man2html 3.0.1 -->
8 <B>mitem_current</B> - set and get current_menu_item
12 <H2>SYNOPSIS</H2><PRE>
13 <B>#include</B> <B><menu.h></B>
14 int set_current_item(MENU *menu, const ITEM *item);
15 ITEM *current_item(const MENU *menu);
16 int set_top_row(MENU *menu, int row);
17 int top_row(const MENU *menu);
18 int item_index(const ITEM *item);
22 <H2>DESCRIPTION</H2><PRE>
23 The function <B>set_current_item</B> sets the current item (the
24 item on which the menu cursor is positioned). <B>cur-</B>
25 <B>rent_item</B> returns a pointer to the current item in the
28 The function <B>set_top_row</B> sets the top row of the menu to
29 show the given row (the top row is initially 0, and is
30 reset to this value whenever the <B>O_ROWMAJOR</B> option is tog-
31 gled). The item leftmost on the given row becomes cur-
32 rent. The function <B>top_row</B> returns the number of the top
33 menu row being displayed.
35 The function <B>item_index</B> returns the (zero-origin) index of
36 <I>item</I> in the menu's item pointer list.
40 <H2>RETURN VALUE</H2><PRE>
41 <B>current_item</B> returns <B>NULL</B> on error.
43 <B>top_row</B> and <B>item_index</B> return <B>ERR</B> (the general <B>curses</B>
44 error value) on error.
46 <B>set_current_item</B> and <B>set_top_row</B> return one of the follow-
49 <B>E_OK</B> The routine succeeded.
52 System error occurred (see <B>errno</B>).
55 Routine detected an incorrect or out-of-range argu-
59 Routine was called from an initialization or termina-
62 <B>E_NOT_CONNECTED</B>
63 No items are connected to the menu.
67 <H2>SEE ALSO</H2><PRE>
68 <B><A HREF="ncurses.3x.html">curses(3x)</A></B>, <B><A HREF="menu.3x.html">menu(3x)</A></B>.
73 The header file <B><menu.h></B> automatically includes the header
74 file <B><curses.h></B>.
78 <H2>PORTABILITY</H2><PRE>
79 These routines emulate the System V menu library. They
80 were not supported on Version 7 or BSD versions.
82 The SVr4 menu library documentation specifies the <B>top_row</B>
83 and <B>index_item</B> error value as -1 (which is the value of
89 Juergen Pfeifer. Manual pages and adaptation for new
90 curses by Eric S. Raymond.
133 Man(1) output converted with
134 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>