4 \fBmenu_driver\fR - command-processing loop of the menu system
6 \fB#include <menu.h>\fR
8 int menu_driver(MENU *menu, int c);
11 Once a menu has been posted (displayed), you should funnel input events to it
12 through \fBmenu_driver\fR. This routine has two major input cases; either
13 the input is a menu navigation request or it's a printable ASCII character.
14 The menu driver requests are as follows:
20 Move right to an item.
41 Move to the first item.
44 Move to the last item.
47 Move to the next item.
50 Move to the previous item.
53 Select/deselect an item.
56 Clear the menu pattern buffer.
59 Delete the previous character from the pattern buffer.
62 Move to the next item matching the pattern match.
65 Move to the previous item matching the pattern match.
67 If the second argument is a printable ASCII character, the code appends
68 it to the pattern buffer and attempts to move to the next item matching
69 the new pattern. If there is no such match, \fBmenu_driver\fR returns
70 \fBE_NO_MATCH\fR and deletes the appended character from the buffer.
72 If the second argument is one of the above pre-defined requests, the
73 corresponding action is performed.
75 If the second argument is neither printable ASCII nor one of the above
76 pre-defined menu requests, the drive assumes it is an application-specific
77 command and returns \fBE_UNKNOWN_COMMAND\fR. Application-defined commands
78 should be defined relative to \fBMAX_COMMAND\fR, the maximum value of these
81 \fBmenu_driver\fR return one of the following error codes:
84 The routine succeeded.
87 System error occurred (see \fBerrno\fR).
90 Routine detected an incorrect or out-of-range argument.
93 Routine was called from an initialization or termination function.
96 The menu has not been posted.
98 \fBE_UNKNOWN_COMMAND\fR
99 The menu driver code saw an unknown request code.
102 Character failed to match.
104 \fBE_REQUEST_DENIED\fR
105 The menu driver could not process the request.
107 \fBcurses\fR(3X), \fBmenus\fR(3x).
109 The header file \fB<menu.h>\fR automatically includes the header files
112 These routines emulate the System V menu library. They were not supported on
113 Version 7 or BSD versions.
115 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric
118 .\"# The following sets edit modes for GNU EMACS
119 .\"# Local Variables: