]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/menu.3x.html
74fe0b7f24bfa47bd600668b789dc6f3f8633de1
[ncurses.git] / doc / html / man / menu.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>menu</B> - curses extension for programming menus
9
10
11 </PRE>
12 <H2>SYNOPSIS</H2><PRE>
13        <B>#include</B> <B>&lt;menu.h&gt;</B>
14
15
16 </PRE>
17 <H2>DESCRIPTION</H2><PRE>
18        The  <B>menu</B> library provides terminal-independent facilities
19        for composing menu systems  on  character-cell  terminals.
20        The library includes: item routines, which create and mod-
21        ify menu items; and menu routines, which group items  into
22        menus, display menus on the screen, and handle interaction
23        with the user.
24
25        The <B>menu</B> library uses the <B>curses</B> libraries, and  a  curses
26        initialization  routine  such  as  <B>initscr</B>  must be called
27        before using any of these  functions.   To  use  the  <B>menu</B>
28        library, link with the options <B>-lmenu</B> <B>-lcurses</B>.
29
30
31    <B>Current</B> <B>Default</B> <B>Values</B> <B>for</B> <B>Item</B> <B>Attributes</B>
32        The  <B>menu</B>  library  maintains  a  default  value  for item
33        attributes.  You can get or set this  default  by  calling
34        the  appropriate  <B>get_</B>  or  <B>set_</B>  routine with a <B>NULL</B> item
35        pointer.  Changing  this  default  with  a  <B>set_</B>  function
36        affects  future  item  creations,  but does not change the
37        rendering of items already created.
38
39
40    <B>Routine</B> <B>Name</B> <B>Index</B>
41        The following table lists each <B>menu</B> routine and  the  name
42        of the manual page on which it is described.
43
44        <B>curses</B> Routine Name    Manual Page Name
45        --------------------------------------------
46        current_item           <B><A HREF="mitem_current.3x.html">mitem_current(3x)</A></B>
47        free_item              <B><A HREF="mitem_new.3x.html">mitem_new(3x)</A></B>
48        free_menu              <B><A HREF="menu_new.3x.html">menu_new(3x)</A></B>
49        item_count             <B><A HREF="menu_items.3x.html">menu_items(3x)</A></B>
50        item_description       <B><A HREF="mitem_name.3x.html">mitem_name(3x)</A></B>
51        item_index             <B><A HREF="mitem_current.3x.html">mitem_current(3x)</A></B>
52        item_init              <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
53        item_name              <B><A HREF="mitem_name.3x.html">mitem_name(3x)</A></B>
54        item_opts              <B><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></B>
55        item_opts_off          <B><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></B>
56        item_opts_on           <B><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></B>
57        item_term              <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
58        item_userptr           <B><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></B>
59        item_value             <B><A HREF="mitem_value.3x.html">mitem_value(3x)</A></B>
60        item_visible           <B><A HREF="mitem_visible.3x.html">mitem_visible(3x)</A></B>
61        menu_back              <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
62        menu_driver            <B><A HREF="menu_driver.3x.html">menu_driver(3x)</A></B>
63        menu_fore              <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
64
65        menu_format            <B><A HREF="menu_format.3x.html">menu_format(3x)</A></B>
66        menu_grey              <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
67        menu_init              <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
68        menu_items             <B><A HREF="menu_items.3x.html">menu_items(3x)</A></B>
69        menu_mark              <B><A HREF="menu_mark.3x.html">menu_mark(3x)</A></B>
70        menu_opts              <B><A HREF="menu_opts.3x.html">menu_opts(3x)</A></B>
71        menu_opts_off          <B><A HREF="menu_opts.3x.html">menu_opts(3x)</A></B>
72        menu_opts_on           <B><A HREF="menu_opts.3x.html">menu_opts(3x)</A></B>
73        menu_pad               <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
74        menu_pattern           <B><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></B>
75        menu_request_by_name   <B><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></B>
76        menu_request_name      <B><A HREF="menu_requestname.3x.html">menu_requestname(3x)</A></B>
77        menu_spacing           <B><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></B>
78        menu_sub               <B><A HREF="menu_win.3x.html">menu_win(3x)</A></B>
79        menu_term              <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
80        menu_userptr           <B><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></B>
81        menu_win               <B><A HREF="menu_win.3x.html">menu_win(3x)</A></B>
82        new_item               <B><A HREF="mitem_new.3x.html">mitem_new(3x)</A></B>
83        new_menu               <B><A HREF="menu_new.3x.html">menu_new(3x)</A></B>
84        pos_menu_cursor        <B><A HREF="menu_cursor.3x.html">menu_cursor(3x)</A></B>
85        post_menu              <B><A HREF="menu_post.3x.html">menu_post(3x)</A></B>
86        scale_menu             <B><A HREF="menu_win.3x.html">menu_win(3x)</A></B>
87        set_current_item       <B><A HREF="mitem_current.3x.html">mitem_current(3x)</A></B>
88        set_item_init          <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
89        set_item_opts          <B><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></B>
90        set_item_term          <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
91        set_item_userptr       <B><A HREF="mitem_userptr.3x.html">mitem_userptr(3x)</A></B>
92        set_item_value         <B><A HREF="mitem_value.3x.html">mitem_value(3x)</A></B>
93        set_menu_back          <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
94        set_menu_fore          <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
95        set_menu_format        <B><A HREF="menu_format.3x.html">menu_format(3x)</A></B>
96        set_menu_grey          <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
97        set_menu_init          <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
98        set_menu_items         <B><A HREF="menu_items.3x.html">menu_items(3x)</A></B>
99        set_menu_mark          <B><A HREF="menu_mark.3x.html">menu_mark(3x)</A></B>
100        set_menu_opts          <B><A HREF="mitem_opts.3x.html">mitem_opts(3x)</A></B>
101        set_menu_pad           <B><A HREF="menu_attribs.3x.html">menu_attribs(3x)</A></B>
102        set_menu_pattern       <B><A HREF="menu_pattern.3x.html">menu_pattern(3x)</A></B>
103        set_menu_spacing       <B><A HREF="menu_spacing.3x.html">menu_spacing(3x)</A></B>
104        set_menu_sub           <B><A HREF="menu_win.3x.html">menu_win(3x)</A></B>
105        set_menu_term          <B><A HREF="menu_hook.3x.html">menu_hook(3x)</A></B>
106        set_menu_userptr       <B><A HREF="menu_userptr.3x.html">menu_userptr(3x)</A></B>
107        set_menu_win           <B><A HREF="menu_win.3x.html">menu_win(3x)</A></B>
108        set_top_row            <B><A HREF="mitem_current.3x.html">mitem_current(3x)</A></B>
109        top_row                <B><A HREF="mitem_current.3x.html">mitem_current(3x)</A></B>
110        unpost_menu            <B><A HREF="menu_post.3x.html">menu_post(3x)</A></B>
111
112
113 </PRE>
114 <H2>RETURN VALUE</H2><PRE>
115        Routines  that return pointers return <B>NULL</B> on error.  Rou-
116        tines that return an integer return one of  the  following
117        error codes:
118
119        <B>E_OK</B> The routine succeeded.
120
121        <B>E_SYSTEM_ERROR</B>
122             System error occurred (see <B>errno</B>).
123
124        <B>E_BAD_ARGUMENT</B>
125             Routine  detected  an incorrect or out-of-range argu-
126             ment.
127
128        <B>E_POSTED</B>
129             The menu is already posted.
130
131        <B>E_BAD_STATE</B>
132             Routine was called from an initialization or termina-
133             tion function.
134
135        <B>E_NO_ROOM</B>
136             Menu is too large for its window.
137
138        <B>E_NOT_POSTED</B>
139             The menu has not been posted.
140
141        <B>E_UNKNOWN_COMMAND</B>
142             The menu driver code saw an unknown request code.
143
144        <B>E_NO_MATCH</B>
145             Character failed to match.
146
147        <B>E_NOT_SELECTABLE</B>
148             The designated item cannot be selected.
149
150        <B>E_NOT_CONNECTED</B>
151             No items are connected to the menu.
152
153        <B>E_REQUEST_DENIED</B>
154             The menu driver could not process the request.
155
156
157 </PRE>
158 <H2>SEE ALSO</H2><PRE>
159        <B><A HREF="ncurses.3x.html">curses(3x)</A></B>  and  3x  pages  whose  names begin "menu_" for
160        detailed descriptions of the entry points.
161
162
163 </PRE>
164 <H2>NOTES</H2><PRE>
165        The header file <B>&lt;menu.h&gt;</B> automatically includes the header
166        files <B>&lt;curses.h&gt;</B> and <B>&lt;eti.h&gt;</B>.
167
168        In  your  library  list,  libmenu.a should be before libn-
169        curses.a; that is, you want to say `-lmenu -lncurses', not
170        the  other  way  around (which would give you a link error
171        using GNU <B><A HREF="ld.1.html">ld(1)</A></B> and many other linkers).
172
173
174 </PRE>
175 <H2>PORTABILITY</H2><PRE>
176        These routines emulate the System V  menu  library.   They
177        were not supported on Version 7 or BSD versions.
178
179
180 </PRE>
181 <H2>AUTHORS</H2><PRE>
182        Juergen  Pfeifer.  Manual pages and adaptation for ncurses
183        by Eric S. Raymond.
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237 </PRE>
238 <HR>
239 <ADDRESS>
240 Man(1) output converted with
241 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
242 </ADDRESS>
243 </BODY>
244 </HTML>