1menu_item_current(3CURSES) Curses Library Functions menu_item_current(3CURSES)
2
3
4
6 menu_item_current, set_current_item, current_item, set_top_row,
7 top_row, item_index - set and get current menus items
8
10 cc [ flag... ] file... -lmenu -lcurses [ library... ]
11 #include <menu.h>
12
13 int set_current_item(MENU *menu, ITEM *item);
14
15
16 ITEM *current_item(MENU *menu);
17
18
19 int set_top_row(MENU *menu, int row);
20
21
22 int top_row(MENU *menu);
23
24
25 int item_index(ITEM *item);
26
27
29 The current item of a menu is the item where the cursor is currently
30 positioned. set_current_item() sets the current item of menu to item.
31 current_item() returns a pointer to the the current item in menu.
32
33
34 set_top_row() sets the top row of menu to row. The left-most item on
35 the new top row becomes the current item. top_row() returns the number
36 of the menu row currently displayed at the top of menu.
37
38
39 item_index() returns the index to the item in the item pointer array.
40 The value of this index ranges from 0 through N-1, where N is the total
41 number of items connected to the menu.
42
44 current_item() returns NULL on error.
45
46
47 top_row() and index_item() return −1 on error.
48
49
50 set_current_item() and set_top_row() return one of the following:
51
52 E_OK The routine returned successfully.
53
54
55 E_SYSTEM_ERROR System error.
56
57
58 E_BAD_ARGUMENT An incorrect argument was passed to the routine.
59
60
61 E_BAD_STATE The routine was called from an initialization or
62 termination function.
63
64
65 E_NOT_CONNECTED No items are connected to the menu.
66
67
69 See attributes(5) for descriptions of the following attributes:
70
71
72
73
74 ┌─────────────────────────────┬─────────────────────────────┐
75 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
76 ├─────────────────────────────┼─────────────────────────────┤
77 │MT-Level │Unsafe │
78 └─────────────────────────────┴─────────────────────────────┘
79
81 curses(3CURSES), menus(3CURSES), attributes(5)
82
84 The header <menu.h> automatically includes the headers <eti.h> and
85 <curses.h>.
86
87
88
89SunOS 5.11 31 Dec 1996 menu_item_current(3CURSES)