]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/menu_format.3x
ncurses 4.2
[ncurses.git] / man / menu_format.3x
1 '\" t
2 .TH menu_format 3X ""
3 .SH NAME
4 \fBmenu_format\fR - set and get menu sizes
5 .SH SYNOPSIS
6 \fB#include <menu.h>\fR
7 .br
8 int set_menu_format(MENU *menu, int rows, int cols);
9 .br
10 int menu_format(const MENU *menu, int *rows, int *cols);
11 .br
12 .SH DESCRIPTION
13 The function \fBset_menu_format\fR sets the maximum display size of the given
14 menu.  If this size is too small to display all menu items, the menu will be
15 made scrollable. If this size is larger than the menus subwindow and the
16 subwindow is too small to display all menu items, \fBpost_menu()\fR will fail.
17
18 The default format is 16 rows, 1 column.  Calling \fBset_menu_format\fR with a
19 null menu pointer will change this default.  A zero row or column argument to
20 \fBset_menu_format\fR is interpreted as a request not to change the current
21 value.
22  
23 The function \fBmenu_format\fR returns the maximum-size constraints for the
24 given menu into the storage addressed by \fBrows\fR and \fBcols\fR.
25 .SH RETURN VALUE
26 These routines returns one of the following:
27 .TP 5
28 \fBE_OK\fR
29 The routine succeeded.
30 .TP 5
31 \fBE_SYSTEM_ERROR\fR
32 System error occurred (see \fBerrno\fR).
33 .TP 5
34 \fBE_BAD_ARGUMENT\fR
35 Routine detected an incorrect or out-of-range argument.
36 .TP 5
37 \fBE_POSTED\fR
38 The menu is already posted.
39 .SH SEE ALSO
40 \fBcurses\fR(3X), \fBmenu\fR(3X).
41 .SH NOTES
42 The header file \fB<menu.h>\fR automatically includes the header file
43 \fB<curses.h>\fR.
44 .SH PORTABILITY
45 These routines emulate the System V menu library.  They were not supported on
46 Version 7 or BSD versions.
47 .SH AUTHORS
48 Juergen Pfeifer.  Manual pages and adaptation for new curses by Eric
49 S. Raymond.
50 .\"#
51 .\"# The following sets edit modes for GNU EMACS
52 .\"# Local Variables:
53 .\"# mode:nroff
54 .\"# fill-column:79
55 .\"# End: