menu_win(3X)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

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 (see errno(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