1mitem_current(3X) mitem_current(3X)
2
3
4
6 mitem_current - set and get current_menu_item
7
9 #include <menu.h>
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);
15
17 The function set_current_item sets the current item (the item on which
18 the menu cursor is positioned). current_item returns a pointer to the
19 current item in the given menu.
20
21 The function set_top_row sets the top row of the menu to show the given
22 row (the top row is initially 0, and is reset to this value whenever
23 the O_ROWMAJOR option is toggled). The item leftmost on the given row
24 becomes current. The function top_row returns the number of the top
25 menu row being displayed.
26
27 The function item_index returns the (zero-origin) index of item in the
28 menu's item pointer list.
29
31 current_item returns a pointer (which may be NULL). It does not set
32 errno.
33
34 top_row and item_index return ERR (the general curses error value) if
35 their menu parameter is NULL.
36
37 set_current_item and set_top_row return one of the following:
38
39 E_OK The routine succeeded.
40
41 E_BAD_ARGUMENT
42 Routine detected an incorrect or out-of-range argument.
43
44 E_BAD_STATE
45 Routine was called from an initialization or termination function.
46
47 E_NOT_CONNECTED
48 No items are connected to the menu.
49
50 E_SYSTEM_ERROR
51 System error occurred (see errno).
52
54 curses(3X), menu(3X).
55
57 The header file <menu.h> automatically includes the header file
58 <curses.h>.
59
61 These routines emulate the System V menu library. They were not sup‐
62 ported on Version 7 or BSD versions.
63
64 The SVr4 menu library documentation specifies the top_row and
65 index_item error value as -1 (which is the value of ERR).
66
68 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S.
69 Raymond.
70
71
72
73 mitem_current(3X)