4 <STRONG>mitem_current</STRONG> - set and get current_menu_item
9 <STRONG>#include</STRONG> <STRONG><menu.h></STRONG>
10 int set_current_item(MENU *menu, const ITEM *item);
11 ITEM *current_item(const MENU *menu);
12 int set_top_row(MENU *menu, int row);
13 int top_row(const MENU *menu);
14 int item_index(const ITEM *item);
18 <H2>DESCRIPTION</H2><PRE>
19 The function <STRONG>set_current_item</STRONG> sets the current item (the
20 item on which the menu cursor is positioned). <STRONG>cur-</STRONG>
21 <STRONG>rent_item</STRONG> returns a pointer to the current item in the
24 The function <STRONG>set_top_row</STRONG> sets the top row of the menu to
25 show the given row (the top row is initially 0, and is
26 reset to this value whenever the <STRONG>O_ROWMAJOR</STRONG> option is tog-
27 gled). The item leftmost on the given row becomes cur-
28 rent. The function <STRONG>top_row</STRONG> returns the number of the top
29 menu row being displayed.
31 The function <STRONG>item_index</STRONG> returns the (zero-origin) index of
32 <EM>item</EM> in the menu's item pointer list.
36 <H2>RETURN VALUE</H2><PRE>
37 <STRONG>current_item</STRONG> returns <STRONG>NULL</STRONG> on error.
39 <STRONG>top_row</STRONG> and <STRONG>item_index</STRONG> return <STRONG>ERR</STRONG> (the general <STRONG>curses</STRONG>
40 error value) on error.
42 <STRONG>set_current_item</STRONG> and <STRONG>set_top_row</STRONG> return one of the follow-
45 <STRONG>E_OK</STRONG> The routine succeeded.
47 <STRONG>E_SYSTEM_ERROR</STRONG>
48 System error occurred (see <STRONG>errno</STRONG>).
50 <STRONG>E_BAD_ARGUMENT</STRONG>
51 Routine detected an incorrect or out-of-range argu-
54 <STRONG>E_BAD_STATE</STRONG>
55 Routine was called from an initialization or termina-
58 <STRONG>E_NOT_CONNECTED</STRONG>
59 No items are connected to the menu.
63 <H2>SEE ALSO</H2><PRE>
64 The header file <STRONG><menu.h></STRONG> automatically includes the header
65 file <STRONG><curses.h></STRONG>.
69 <H2>PORTABILITY</H2><PRE>
70 These routines emulate the System V menu library. They
71 were not supported on Version 7 or BSD versions.
73 The SVr4 menu library documentation specifies the <STRONG>top_row</STRONG>
74 and <STRONG>index_item</STRONG> error value as -1 (which is the value of
75 <STRONG>ERR</STRONG>).
80 Juergen Pfeifer. Manual pages and adaptation for new
81 curses by Eric S. Raymond.