Update ncurses to version 5.4.
[dragonfly.git] / lib / libncurses / man / menu_hook.3
1 '\" t
2 .\"***************************************************************************
3 .\" Copyright (c) 1998 Free Software Foundation, Inc.                        *
4 .\"                                                                          *
5 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
6 .\" copy of this software and associated documentation files (the            *
7 .\" "Software"), to deal in the Software without restriction, including      *
8 .\" without limitation the rights to use, copy, modify, merge, publish,      *
9 .\" distribute, distribute with modifications, sublicense, and/or sell       *
10 .\" copies of the Software, and to permit persons to whom the Software is    *
11 .\" furnished to do so, subject to the following conditions:                 *
12 .\"                                                                          *
13 .\" The above copyright notice and this permission notice shall be included  *
14 .\" in all copies or substantial portions of the Software.                   *
15 .\"                                                                          *
16 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23 .\"                                                                          *
24 .\" Except as contained in this notice, the name(s) of the above copyright   *
25 .\" holders shall not be used in advertising or otherwise to promote the     *
26 .\" sale, use or other dealings in this Software without prior written       *
27 .\" authorization.                                                           *
28 .\"***************************************************************************
29 .\"
30 .\" $Id: menu_hook.3x,v 1.6 1998/11/29 01:09:47 Rick.Ohnemus Exp $
31 .\" $DragonFly: src/lib/libncurses/man/menu_hook.3,v 1.1 2005/03/12 19:13:54 eirikn Exp $
32 .TH menu_hook 3X ""
33 .SH NAME
34 \fBmenu_hook\fR - set hooks for automatic invocation by applications
35 .SH SYNOPSIS
36 \fB#include <menu.h>\fR
37 .br
38 int set_item_init(MENU *menu, void (*func)(MENU *));
39 .br
40 void (*)(MENU *) item_init(const MENU *menu);
41 .br
42 int set_item_term(MENU *menu, void (*func)(MENU *));
43 .br
44 void (*)(MENU *) item_term(const MENU *menu);
45 .br
46 int set_menu_init(MENU *menu, void (*func)(MENU *));
47 .br
48 void (*)(MENU *) menu_init(const MENU *menu);
49 .br
50 int set_menu_term(MENU *menu, void (*func)(MENU *));
51 .br
52 void (*)(MENU *) menu_term(const MENU *menu);
53 .br
54 .SH DESCRIPTION
55 These functions make it possible to set hook functions to be called at various
56 points in the automatic processing of input event codes by \fBmenu_driver\fR.
57
58 The function \fBset_item_init\fR sets a hook to be called at menu-post time and
59 each time the selected item changes (after the change).  \fBitem_init\fR
60 returns the current item init hook, if any (\fBNULL\fR if there is no such
61 hook).
62
63 The function \fBset_item_term\fR sets a hook to be called at menu-unpost time
64 and each time the selected item changes (before the change).  \fBitem_term\fR
65 returns the current item term hook, if any (\fBNULL\fR if there is no such
66 hook).
67
68 The function \fBset_menu_init\fR sets a hook to be called at menu-post time and
69 just after the top row on the menu changes once it is posted.  \fBmenu_init\fR
70 returns the current menu init hook, if any (\fBNULL\fR if there is no such
71 hook).
72
73 The function \fBset_menu_term\fR sets a hook to be called at menu-unpost time
74 and just before the top row on the menu changes once it is posted.
75 \fBmenu_term\fR returns the current menu term hook, if any (\fBNULL\fR if there
76 is no such hook).
77 .SH RETURN VALUE
78 Routines that return pointers return \fBNULL\fR on error.  Other routines
79 return one of the following:
80 .TP 5
81 \fBE_OK\fR
82 The routine succeeded.
83 .TP 5
84 \fBE_SYSTEM_ERROR\fR
85 System error occurred (see \fBerrno\fR).
86 .SH SEE ALSO
87 \fBcurses\fR(3X), \fBmenu\fR(3X).
88 .SH NOTES
89 The header file \fB<menu.h>\fR automatically includes the header file
90 \fB<curses.h>\fR.
91 .SH PORTABILITY
92 These routines emulate the System V menu library.  They were not supported on
93 Version 7 or BSD versions.
94 .SH AUTHORS
95 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
96 S. Raymond.
97 .\"#
98 .\"# The following sets edit modes for GNU EMACS
99 .\"# Local Variables:
100 .\"# mode:nroff
101 .\"# fill-column:79
102 .\"# End: