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