]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/menu_win.3x
ncurses 6.4 - patch 20240414
[ncurses.git] / man / menu_win.3x
1 .\"***************************************************************************
2 .\" Copyright 2018-2023,2024 Thomas E. Dickey                                *
3 .\" Copyright 1998-2006,2010 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_win.3x,v 1.32 2024/03/16 15:35:01 tom Exp $
31 .TH menu_win 3X 2024-03-16 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "Library calls"
32 .SH NAME
33 \fBmenu_win\fP \-
34 make and break menu window and subwindow associations
35 .SH SYNOPSIS
36 .nf
37 \fB#include <menu.h>
38 .PP
39 \fBint set_menu_win(MENU *\fImenu\fP, WINDOW *\fIwin\fP);
40 \fBWINDOW *menu_win(const MENU *\fImenu\fP);
41 .PP
42 \fBint set_menu_sub(MENU *\fImenu\fP, WINDOW *\fIsub\fP);
43 \fBWINDOW *menu_sub(const MENU *\fImenu\fP);
44 .PP
45 \fBint scale_menu(const MENU *\fImenu\fP, int *\fIrows\fP, int *\fIcolumns\fP);
46 .fi
47 .SH DESCRIPTION
48 Every menu has an associated pair of \fBcurses\fP windows.
49 The menu window
50 displays any title and border associated with the window; the menu subwindow
51 displays the items of the menu that are currently available for selection.
52 .PP
53 The first four functions get and set those windows.
54 It is not necessary to set
55 either window; by default, the driver code uses \fBstdscr\fP for both.
56 .PP
57 In the \fBset_\fP functions, window argument of \fBNULL\fP is treated as though
58 it were \fBstsdcr\fP.  A menu argument of \fBNULL\fP is treated as a request
59 to change the system default menu window or subwindow.
60 .PP
61 The function \fBscale_menu\fP returns the minimum size required for the
62 subwindow of \fImenu\fP.
63 .SH RETURN VALUE
64 Routines that return pointers return \fBNULL\fP on error.
65 Routines that return
66 an integer return one of the following error codes:
67 .TP 5
68 .B E_OK
69 The routine succeeded.
70 .TP 5
71 .B E_SYSTEM_ERROR
72 System error occurred (see \fBerrno\fP(3)).
73 .TP 5
74 .B E_BAD_ARGUMENT
75 Routine detected an incorrect or out-of-range argument.
76 .TP 5
77 .B E_POSTED
78 The menu has already been posted.
79 .TP 5
80 .B E_NOT_CONNECTED
81 No items are connected to the menu.
82 .SH PORTABILITY
83 These routines emulate the System V menu library.
84 They were not supported on
85 Version 7 or BSD versions.
86 .SH AUTHORS
87 Juergen Pfeifer.
88 Manual pages and adaptation for new curses by Eric S. Raymond.
89 .SH SEE ALSO
90 \fB\%curses\fP(3X),
91 \fB\%curs_variables\fP(3X),
92 \fB\%menu\fP(3X)