2 .\"***************************************************************************
3 .\" Copyright (c) 1998-2007,2010 Free Software Foundation, Inc. *
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: *
13 .\" The above copyright notice and this permission notice shall be included *
14 .\" in all copies or substantial portions of the Software. *
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. *
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 *
28 .\"***************************************************************************
30 .\" $Id: menu_hook.3x,v 1.11 2010/12/04 18:40:45 tom Exp $
33 \fBmenu_hook\fR \- set hooks for automatic invocation by applications
35 \fB#include <menu.h>\fR
37 int set_item_init(MENU *menu, Menu_Hook func);
39 Menu_Hook item_init(const MENU *menu);
41 int set_item_term(MENU *menu, Menu_Hook func);
43 Menu_Hook item_term(const MENU *menu);
45 int set_menu_init(MENU *menu, Menu_Hook func);
47 Menu_Hook menu_init(const MENU *menu);
49 int set_menu_term(MENU *menu, Menu_Hook func);
51 Menu_Hook menu_term(const MENU *menu);
54 These functions make it possible to set hook functions to be called at various
55 points in the automatic processing of input event codes by \fBmenu_driver\fR.
57 The function \fBset_item_init\fR sets a hook to be called at menu-post time and
58 each time the selected item changes (after the change). \fBitem_init\fR
59 returns the current item init hook, if any (\fBNULL\fR if there is no such
62 The function \fBset_item_term\fR sets a hook to be called at menu-unpost time
63 and each time the selected item changes (before the change). \fBitem_term\fR
64 returns the current item term hook, if any (\fBNULL\fR if there is no such
67 The function \fBset_menu_init\fR sets a hook to be called at menu-post time and
68 just after the top row on the menu changes once it is posted. \fBmenu_init\fR
69 returns the current menu init hook, if any (\fBNULL\fR if there is no such
72 The function \fBset_menu_term\fR sets a hook to be called at menu-unpost time
73 and just before the top row on the menu changes once it is posted.
74 \fBmenu_term\fR returns the current menu term hook, if any (\fBNULL\fR if there
77 Routines that return pointers return \fBNULL\fR on error. Other routines
78 return one of the following:
81 The routine succeeded.
84 System error occurred (see \fBerrno\fR).
86 \fBcurses\fR(3X), \fBmenu\fR(3X).
88 The header file \fB<menu.h>\fR automatically includes the header file
91 These routines emulate the System V menu library. They were not supported on
92 Version 7 or BSD versions.
94 Juergen Pfeifer. Manual pages and adaptation for new curses by Eric