menu_win(3X)

okay bestie, welcome to menu_win(3X) β€” yes that's the library-calls section of the manual, and yes this whole page is about making and breaking menu window and subwindow associations πŸͺŸβœ¨


🌸 NAME 🌸

menu_win β€” make and break menu window and subwindow associations


πŸŽ€ 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);

✨ DESCRIPTION ✨

so every menu has a little duo of curses windows attached to it, like a main character and their bestie 🫢

  • the menu window shows any title and border that's associated with the window πŸ‘‘
  • the menu subwindow shows the items of the menu that are currently available for selection πŸ“

the first four functions get and set those windows. and no, you do not have to set either one β€” by default the driver code just uses stdscr for both. lowkey convenient, fr fr 😌

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 🌈

and the function scale_menu returns the minimum size required for the subwindow of menu. it's giving "how much room do i need" energy πŸ’–


πŸ”₯ RETURN VALUE πŸ”₯

routines that return pointers return NULL on error. routines that return an integer return one of these error codes, no cap:

  • 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 if you're on one of those, bestie, this is not the vibe 🚫


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond.


πŸ¦‹ SEE ALSO πŸ¦‹

curses(3X), curs_variables(3X), menu(3X)


and that's the whole page, periodt πŸ’œ this one came from ncurses 6.6, dated 2024-12-28 β€” so like, go forth and associate your windows, icon πŸŽ€βœ¨

πŸ“¦ where this page comes from