xref: /netbsd-src/lib/libmenu/menu_hook.3 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1*01869ca4Swiz.\"	$NetBSD: menu_hook.3,v 1.9 2017/07/03 21:32:50 wiz Exp $
268f24b78Skleink.\"
3b68c50bcSblymn.\" Copyright (c) 1999
4b68c50bcSblymn.\"	Brett Lymn - blymn@baea.com.au, brett_lymn@yahoo.com.au
5b68c50bcSblymn.\"
6b68c50bcSblymn.\" This code is donated to The NetBSD Foundation by the author.
7b68c50bcSblymn.\"
8b68c50bcSblymn.\" Redistribution and use in source and binary forms, with or without
9b68c50bcSblymn.\" modification, are permitted provided that the following conditions
10b68c50bcSblymn.\" are met:
11b68c50bcSblymn.\" 1. Redistributions of source code must retain the above copyright
12b68c50bcSblymn.\"    notice, this list of conditions and the following disclaimer.
13b68c50bcSblymn.\" 2. Redistributions in binary form must reproduce the above copyright
14b68c50bcSblymn.\"    notice, this list of conditions and the following disclaimer in the
15b68c50bcSblymn.\"    documentation and/or other materials provided with the distribution.
16b68c50bcSblymn.\" 3. The name of the Author may not be used to endorse or promote
17b68c50bcSblymn.\"    products derived from this software without specific prior written
18b68c50bcSblymn.\"    permission.
19b68c50bcSblymn.\"
20b68c50bcSblymn.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21b68c50bcSblymn.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22b68c50bcSblymn.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23b68c50bcSblymn.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
24b68c50bcSblymn.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25b68c50bcSblymn.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26b68c50bcSblymn.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27b68c50bcSblymn.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28b68c50bcSblymn.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29b68c50bcSblymn.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30b68c50bcSblymn.\" SUCH DAMAGE.
31b68c50bcSblymn.\"
321a71a68bSwiz.Dd September 10, 1999
33b68c50bcSblymn.Dt MENU_HOOK 3
341a71a68bSwiz.Os
35b68c50bcSblymn.Sh NAME
36b68c50bcSblymn.Nm item_init ,
37b68c50bcSblymn.Nm item_term ,
38b68c50bcSblymn.Nm menu_init ,
39b68c50bcSblymn.Nm menu_term ,
40b68c50bcSblymn.Nm set_item_init ,
41b68c50bcSblymn.Nm set_item_term ,
42b68c50bcSblymn.Nm set_menu_init ,
43b68c50bcSblymn.Nm set_menu_term
441a71a68bSwiz.Nd get or set handler functions for menu post/unpost or item change
45b68c50bcSblymn.Sh LIBRARY
46b68c50bcSblymn.Lb libmenu
47b68c50bcSblymn.Sh SYNOPSIS
48472351e1Swiz.In menu.h
49b68c50bcSblymn.Ft void (*hook)()
50b68c50bcSblymn.Fn item_init "MENU *menu"
51b68c50bcSblymn.Ft void (*hook)()
52b68c50bcSblymn.Fn item_term "MENU *menu"
53b68c50bcSblymn.Ft void (*hook)()
54b68c50bcSblymn.Fn menu_init "MENU *menu"
55b68c50bcSblymn.Ft void (*hook)()
56b68c50bcSblymn.Fn menu_term "MENU *menu"
57b68c50bcSblymn.Ft int
58b68c50bcSblymn.Fn set_item_init "MENU *menu" "void (*hook)())"
59b68c50bcSblymn.Ft int
60b68c50bcSblymn.Fn set_item_term "MENU *menu" "void (*hook)())"
61b68c50bcSblymn.Ft int
62b68c50bcSblymn.Fn set_menu_init "MENU *menu" "void (*hook)())"
63b68c50bcSblymn.Ft int
64b68c50bcSblymn.Fn set_menu_term "MENU *menu" "void (*hook)())"
65b68c50bcSblymn.Sh DESCRIPTION
66b68c50bcSblymnThe
67b68c50bcSblymn.Fn item_init
68b68c50bcSblymnfunction returns a pointer to the function that will be called
69b68c50bcSblymnwhenever the menu is posted and also just after the current item
7057a4de98Swizchanges.
7157a4de98SwizThis is set by the
72b68c50bcSblymn.Fn set_item_init
7357a4de98Swizcall.
7457a4de98SwizThe
75b68c50bcSblymn.Fn item_term
76b68c50bcSblymnfunction returns a pointer to the function that will be called before
77b68c50bcSblymnthe menu is unposted and just before the current item changes, this
78b68c50bcSblymnpointer is set by the
79b68c50bcSblymn.Fn set_item_term
80b68c50bcSblymncall.
81b68c50bcSblymnThe
82b68c50bcSblymn.Fn menu_init
83b68c50bcSblymnfunctions returns a pointer to the function that will be called just
8457a4de98Swizbefore the menu is posted to the screen.
8557a4de98SwizThis pointer is set by the
86b68c50bcSblymn.Fn set_menu_init
87b68c50bcSblymnfunction call.
88b68c50bcSblymnThe
89b68c50bcSblymn.Fn menu_term
90b68c50bcSblymnfunction returns a pointer to the function that will be called just
91b68c50bcSblymnafter the menu has been unposted, this pointer is set by the
92b68c50bcSblymn.Fn set_menu_term
93b68c50bcSblymnfunction.
94b68c50bcSblymn.Sh SEE ALSO
95b68c50bcSblymn.Xr curses 3 ,
96b68c50bcSblymn.Xr menus 3
97b68c50bcSblymn.Sh NOTES
98b68c50bcSblymnThe header
99*01869ca4Swiz.Pa <menu.h>
100b68c50bcSblymnautomatically includes both
101*01869ca4Swiz.Pa <curses.h>
102b68c50bcSblymnand
103*01869ca4Swiz.Pa <eti.h> .
104