menu_format(3X)

okay bestie, welcome to the menu_format(3X) page from the Library calls section β€” yes we're in the ncurses 6.6 cinematic universe and it's giving very demure, very mindful, very System V πŸ’…


✨ NAME ✨

set_menu_format, menu_format β€” set and get menu sizes πŸŽ€


🌸 SYNOPSIS 🌸

#include <menu.h>

int set_menu_format(MENU *menu, int rows, int cols);
void menu_format(const MENU *menu, int *rows, int *cols);

πŸ¦‹ DESCRIPTION πŸ¦‹

so set_menu_format is the one that sets the maximum display size of the menu you hand it. cute, right?

and like β€” if that size is too small to display all the menu items? the menu gets made scrollable. no cap, it just becomes scrollable. iconic behaviour honestly.

but if that size is larger than the menu's subwindow and the subwindow is too small to display all menu items, then post_menu will fail. πŸ’€ so like, be careful with that one.

the default format is 16 rows, 1 column. yes really. that's the vibe out of the box.

calling set_menu_format with a null menu pointer will change this default. 🫢

and a zero row or column argument to set_menu_format is interpreted as a request not to change the current value β€” so it's like "no thoughts, keep it as is" ✨

menu_format is the chill getter: it returns the maximum-size constraints for the given menu into the storage addressed by rows and cols. πŸ“¦


⭐ RETURN VALUE ⭐

these routines return one of the following, bestie:

  • E_OK β€” the routine succeeded. slay. πŸŽ€
  • E_SYSTEM_ERROR β€” a system error occurred (peep errno(3)). 😭
  • E_BAD_ARGUMENT β€” the routine detected an incorrect or out-of-range argument. πŸ™ˆ
  • E_POSTED β€” the menu is already posted. it's busy, it's booked, it cannot. πŸ’…
  • E_NOT_CONNECTED β€” no items are connected to the menu. it's giving empty group chat. πŸ’€

🌈 PORTABILITY 🌈

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so like, if you were hoping for BSD energy here... nope, sorry bestie. 🧚


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends, fr fr. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

  • curses(3X)
  • menu(3X)

and that's the whole page, bestie!! this was ncurses 6.6, dated 2024-03-16, and yes the manual page name at the bottom is menu_format(3X) β€” go forth and format those menus, main character πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from