]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/mitem_current.3x.html
ncurses 5.2
[ncurses.git] / doc / html / man / mitem_current.3x.html
1 <HTML>
2 <BODY>
3 <PRE>
4 <!-- Manpage converted by man2html 3.0.1 -->
5
6 </PRE>
7 <H2>NAME</H2><PRE>
8        <B>mitem_current</B> - set and get current_menu_item
9
10
11 </PRE>
12 <H2>SYNOPSIS</H2><PRE>
13        <B>#include</B> <B>&lt;menu.h&gt;</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);
19
20
21 </PRE>
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
26        given menu.
27
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.
34
35        The function <B>item_index</B> returns the (zero-origin) index of
36        <I>item</I> in the menu's item pointer list.
37
38
39 </PRE>
40 <H2>RETURN VALUE</H2><PRE>
41        <B>current_item</B> returns <B>NULL</B> on error.
42
43        <B>top_row</B> and <B>item_index</B>  return  <B>ERR</B>  (the  general  <B>curses</B>
44        error value) on error.
45
46        <B>set_current_item</B> and <B>set_top_row</B> return one of the follow-
47        ing:
48
49        <B>E_OK</B> The routine succeeded.
50
51        <B>E_SYSTEM_ERROR</B>
52             System error occurred (see <B>errno</B>).
53
54        <B>E_BAD_ARGUMENT</B>
55             Routine detected an incorrect or  out-of-range  argu-
56             ment.
57
58        <B>E_BAD_STATE</B>
59             Routine was called from an initialization or termina-
60             tion function.
61
62        <B>E_NOT_CONNECTED</B>
63             No items are connected to the menu.
64
65
66 </PRE>
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>.
69
70
71 </PRE>
72 <H2>NOTES</H2><PRE>
73        The header file <B>&lt;menu.h&gt;</B> automatically includes the header
74        file <B>&lt;curses.h&gt;</B>.
75
76
77 </PRE>
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.
81
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
84        <B>ERR</B>).
85
86
87 </PRE>
88 <H2>AUTHORS</H2><PRE>
89        Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
90        curses by Eric S. Raymond.
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 </PRE>
131 <HR>
132 <ADDRESS>
133 Man(1) output converted with
134 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
135 </ADDRESS>
136 </BODY>
137 </HTML>