NAME |SYNOPSIS |DESCRIPTION |RETURN VALUE |SEE ALSO |NOTES |PORTABILITY |AUTHORS |COLOPHON | |
menu_win(3X)menu_win(3X)menu_win- make and break menu window and subwindow associations
#include <menu.h>int set_menu_win(MENU *menu, WINDOW *win);WINDOW *menu_win(const MENU *menu);int set_menu_sub(MENU *menu, WINDOW *sub);WINDOW *menu_sub(const MENU *menu);int scale_menu(const MENU *menu, int *rows, int *columns);
Every menu has an associated pair ofcurseswindows. The menu window displays any title and border associated with the window; the menu subwindow displays the items of the menu that are currently available for selection. The first four functions get and set those windows. It is not necessary to set either window; by default, the driver code usesstdscrfor both. In theset_functions, window argument ofNULLis treated as though it werestsdcr. A menu argument ofNULLis treated as a request to change the system default menu window or subwindow. The functionscale_menureturns the minimum size required for the subwindow ofmenu.
Routines that return pointers returnNULLon error. Routines that return an integer return one of the following error codes:E_OKThe routine succeeded.E_SYSTEM_ERROR System error occurred (seeerrno(3)).E_BAD_ARGUMENT Routine detected an incorrect or out-of-range argument.E_POSTED The menu has already been posted.E_NOT_CONNECTED No items are connected to the menu.
curses(3X),curs_variables(3X),menu(3X).
The header file<menu.h>automatically includes the header file<curses.h>.
These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions.
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond.
This page is part of thencurses (new curses) project. Information about the project can be found at ⟨https://www.gnu.org/software/ncurses/ncurses.html⟩. If you have a bug report for this manual page, send it to bug-ncurses-request@gnu.org. This page was obtained from the project's upstream Git mirror of the CVS repository ⟨https://github.com/mirror/ncurses.git⟩ on 2025-08-11. (At that time, the date of the most recent commit that was found in the repository was 2023-03-12.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orgmenu_win(3X)HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |