Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2018-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 1998-2007,2010 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 30 | .\" $Id: menu_hook.3x,v 1.32 2024/03/16 15:35:01 tom Exp $ |
| 31 | .TH menu_hook 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls" |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 32 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 33 | \fBmenu_hook\fP \- |
| 34 | set hooks for automatic invocation by applications |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 35 | .SH SYNOPSIS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 36 | .nf |
| 37 | \fB#include <menu.h> |
| 38 | .PP |
| 39 | \fBint set_item_init(MENU *\fImenu\fP, Menu_Hook \fIfunc\fP); |
| 40 | \fBMenu_Hook item_init(const MENU *\fImenu\fP); |
| 41 | .PP |
| 42 | \fBint set_item_term(MENU *\fImenu\fP, Menu_Hook \fIfunc\fP); |
| 43 | \fBMenu_Hook item_term(const MENU *\fImenu\fP); |
| 44 | .PP |
| 45 | \fBint set_menu_init(MENU *\fImenu\fP, Menu_Hook \fIfunc\fP); |
| 46 | \fBMenu_Hook menu_init(const MENU *\fImenu\fP); |
| 47 | .PP |
| 48 | \fBint set_menu_term(MENU *\fImenu\fP, Menu_Hook \fIfunc\fP); |
| 49 | \fBMenu_Hook menu_term(const MENU *\fImenu\fP); |
| 50 | .fi |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 51 | .SH DESCRIPTION |
| 52 | These functions make it possible to set hook functions to be called at various |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 53 | points in the automatic processing of input event codes by \fBmenu_driver\fP. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 54 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 55 | The function \fBset_item_init\fP sets a hook to be called at menu-post time and |
| 56 | each time the selected item changes (after the change). |
| 57 | \fBitem_init\fP |
| 58 | returns the current item init hook, if any (\fBNULL\fP if there is no such |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 59 | hook). |
| 60 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 61 | The function \fBset_item_term\fP sets a hook to be called at menu-unpost time |
| 62 | and each time the selected item changes (before the change). |
| 63 | \fBitem_term\fP |
| 64 | returns the current item term hook, if any (\fBNULL\fP if there is no such |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 65 | hook). |
| 66 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 67 | The function \fBset_menu_init\fP 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. |
| 69 | \fBmenu_init\fP |
| 70 | returns the current menu init hook, if any (\fBNULL\fP if there is no such |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 71 | hook). |
| 72 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 73 | The function \fBset_menu_term\fP sets a hook to be called at menu-unpost time |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 74 | and just before the top row on the menu changes once it is posted. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 75 | \fBmenu_term\fP returns the current menu term hook, if any (\fBNULL\fP if there |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 76 | is no such hook). |
| 77 | .SH RETURN VALUE |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 78 | Routines that return pointers return \fBNULL\fP on error. |
| 79 | Other routines |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 80 | return one of the following: |
| 81 | .TP 5 |
| 82 | .B E_OK |
| 83 | The routine succeeded. |
| 84 | .TP 5 |
| 85 | .B E_SYSTEM_ERROR |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 86 | System error occurred (see \fBerrno\fP(3)). |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 87 | .SH PORTABILITY |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 88 | These routines emulate the System V menu library. |
| 89 | They were not supported on |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 90 | Version 7 or BSD versions. |
| 91 | .SH AUTHORS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 92 | Juergen Pfeifer. |
| 93 | Manual pages and adaptation for new curses by Eric |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 94 | S. Raymond. |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 95 | .SH SEE ALSO |
| 96 | \fB\%curses\fP(3X), |
| 97 | \fB\%menu\fP(3X) |