menu_win(3X)
β¨ menu_win(3X) β¨
okay so bestie, this is a Library calls page from the menu_win(3X) manual and it's literally all about making and breaking connections between menus and their windows π
π NAME π
menu_win β this is the whole vibe of linking a menu to its window, and then un-linking it when you're done. make and break menu window and subwindow associations, periodt.
πΈ SYNOPSIS πΈ
#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);
like, just look at her. iconic signatures fr fr π
π DESCRIPTION π
okay so every menu has an associated pair of curses windows, no cap. it's giving main character duo energy π
- the menu window displays any title and border that's 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. and here's the tea β it is not necessary to set either window, because by default the driver code just uses stdscr for both π«Ά
in the set_ functions, a window argument of NULL is treated as though it were stsdcr. a menu argument of NULL is treated as a request to change the system default menu window or subwindow.
not me reading stsdcr in the original like... yes that's exactly what it says, keep it verbatim bestie, we don't fix facts π
the function scale_menu returns the minimum size required for the subwindow of menu.
π₯ RETURN VALUE π₯
routines that return pointers return NULL on error. routines that return an integer return one of the following error codes:
E_OKβ the routine succeeded. slay β¨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.
π PORTABILITY π
these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so like, don't come for them if you're on some ancient vibe π
π AUTHORS π
Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. absolute legends, we stan π«Ά
π¦ SEE ALSO π¦
curses(3X), curs_variables(3X), menu(3X)
like obviously go read those too, iykyk π
and that's the whole page bestie, no crumbs left πΈ this was ncurses 6.5 from 2024-12-28, and the original was all menu_win(3X) β mwah, go forth and associate those windows π
β¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2006,2010 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms