1mitem_current(3X)                                            mitem_current(3X)
2
3
4

NAME

6       mitem_current - set and get current_menu_item
7

SYNOPSIS

9       #include <menu.h>
10
11       int set_current_item(MENU *menu, ITEM *item);
12       ITEM *current_item(const MENU *menu);
13
14       int set_top_row(MENU *menu, int row);
15       int top_row(const MENU *menu);
16
17       int item_index(const ITEM *item);
18

DESCRIPTION

20       The  function set_current_item sets the current item (the item on which
21       the menu cursor is positioned).  current_item returns a pointer to  the
22       current item in the given menu.
23
24       The function set_top_row sets the top row of the menu to show the given
25       row (the top row is initially 0, and is reset to  this  value  whenever
26       the  O_ROWMAJOR option is toggled).  The item leftmost on the given row
27       becomes current.  The function top_row returns the number  of  the  top
28       menu row being displayed.
29
30       The  function item_index returns the (zero-origin) index of item in the
31       menu's item pointer list.
32

RETURN VALUE

34       current_item returns a pointer (which may be NULL).  It  does  not  set
35       errno.
36
37       top_row  and  item_index return ERR (the general curses error value) if
38       their menu parameter is NULL.
39
40       set_current_item and set_top_row return one of the following:
41
42       E_OK The routine succeeded.
43
44       E_BAD_ARGUMENT
45            Routine detected an incorrect or out-of-range argument.
46
47       E_BAD_STATE
48            Routine was called from an initialization or termination function.
49
50       E_NOT_CONNECTED
51            No items are connected to the menu.
52
53       E_SYSTEM_ERROR
54            System error occurred (see errno(3)).
55

SEE ALSO

57       curses(3X), menu(3X).
58

NOTES

60       The  header  file  <menu.h>  automatically  includes  the  header  file
61       <curses.h>.
62

PORTABILITY

64       These  routines  emulate the System V menu library.  They were not sup‐
65       ported on Version 7 or BSD versions.
66
67       The SVr4 menu library  documentation  specifies  the  top_row  and  in‐
68       dex_item error value as -1 (which is the value of ERR).
69

AUTHORS

71       Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric S.
72       Raymond.
73
74
75
76                                                             mitem_current(3X)
Impressum