jcs's openbsd hax
openbsd
1'\" t
2.\" $OpenBSD: menu_format.3,v 1.9 2023/10/17 09:52:10 nicm Exp $
3.\"
4.\"***************************************************************************
5.\" Copyright 2018-2022,2023 Thomas E. Dickey *
6.\" Copyright 1998-2015,2016 Free Software Foundation, Inc. *
7.\" *
8.\" Permission is hereby granted, free of charge, to any person obtaining a *
9.\" copy of this software and associated documentation files (the *
10.\" "Software"), to deal in the Software without restriction, including *
11.\" without limitation the rights to use, copy, modify, merge, publish, *
12.\" distribute, distribute with modifications, sublicense, and/or sell *
13.\" copies of the Software, and to permit persons to whom the Software is *
14.\" furnished to do so, subject to the following conditions: *
15.\" *
16.\" The above copyright notice and this permission notice shall be included *
17.\" in all copies or substantial portions of the Software. *
18.\" *
19.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
20.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
21.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
22.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
23.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
24.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
25.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
26.\" *
27.\" Except as contained in this notice, the name(s) of the above copyright *
28.\" holders shall not be used in advertising or otherwise to promote the *
29.\" sale, use or other dealings in this Software without prior written *
30.\" authorization. *
31.\"***************************************************************************
32.\"
33.\" $Id: menu_format.3,v 1.9 2023/10/17 09:52:10 nicm Exp $
34.TH menu_format 3 2023-07-01 "ncurses 6.4" "Library calls"
35.SH NAME
36\fBset_menu_format\fP,
37\fBmenu_format\fP \- set and get menu sizes
38.SH SYNOPSIS
39\fB#include <menu.h>\fP
40.sp
41\fBint set_menu_format(MENU *\fImenu\fB, int \fIrows\fB, int \fIcols\fB);\fR
42.br
43\fBvoid menu_format(const MENU *\fImenu\fB, int *\fIrows\fB, int *\fIcols\fB);\fR
44.SH DESCRIPTION
45The function \fBset_menu_format\fP sets the maximum display size of the given
46menu.
47If this size is too small to display all menu items, the menu will be
48made scrollable.
49If this size is larger than the menus subwindow and the
50subwindow is too small to display all menu items, \fBpost_menu\fP will fail.
51.PP
52The default format is 16 rows, 1 column.
53Calling \fBset_menu_format\fP with a
54null menu pointer will change this default.
55A zero row or column argument to
56\fBset_menu_format\fP is interpreted as a request not to change the current
57value.
58.PP
59The function \fBmenu_format\fP returns the maximum-size constraints for the
60given menu into the storage addressed by \fBrows\fP and \fBcols\fP.
61.SH RETURN VALUE
62These routines returns one of the following:
63.TP 5
64.B E_OK
65The routine succeeded.
66.TP 5
67.B E_SYSTEM_ERROR
68System error occurred (see \fBerrno\fP(3)).
69.TP 5
70.B E_BAD_ARGUMENT
71Routine detected an incorrect or out-of-range argument.
72.TP 5
73.B E_POSTED
74The menu is already posted.
75.TP 5
76.B E_NOT_CONNECTED
77No items are connected to the menu.
78.SH SEE ALSO
79\fBcurses\fP(3), \fBmenu\fP(3).
80.SH NOTES
81The header file \fB<menu.h>\fP automatically includes the header file
82\fB<curses.h>\fP.
83.SH PORTABILITY
84These routines emulate the System V menu library.
85They were not supported on
86Version 7 or BSD versions.
87.SH AUTHORS
88Juergen Pfeifer.
89Manual pages and adaptation for new curses by Eric S. Raymond.