format(3MENU)
π format(3MENU) β Library calls, bestie edition π
ok so this is the format(3MENU) page from the ncurses library-calls girlies, and it's literally all about setting and getting your menu sizes. no cap. π
β¨ 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);
like. the whole vibe. two functions. one sets, one gets. iconic. π
β¨ DESCRIPTION β¨
okay so set_menu_format sets the maximum display size of the given menu. that's it, that's the job. β¨
if that size is too small to display all the menu items, the menu gets made scrollable. slay, adaptable queen.
but here's the tea tho π β if this size is larger than the menu's subwindow and the subwindow is too small to display all the menu items, then post_menu will fail. so like, don't do that. fr fr. π
the default format is 16 rows, 1 column. and calling set_menu_format with a null menu pointer will change that default. wild, i know.
also: a zero row or column argument to set_menu_format is interpreted as a request not to change the current value. so zero = "leave it, bestie, it's fine." π
and menu_format? she returns the maximum-size constraints for the given menu into the storage addressed by rows and cols. simple. clean. we love her. π
β¨ RETURN VALUE β¨
these routines return one of the following, and you will respect each one:
E_OKβ the routine succeeded. π ate, no crumbs.E_SYSTEM_ERRORβ a system error occurred (seeerrno(3)). πE_BAD_ARGUMENTβ the routine detected an incorrect or out-of-range argument. πE_POSTEDβ the menu is already 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, historically they were giving niche. now they're everywhere. glow up. π
β¨ AUTHORS β¨
Juergen Pfeifer. π
manual pages and adaptation for new curses by Eric S. Raymond. β¨
β¨ SEE ALSO β¨
ncurses(3NCURSES)menu(3MENU)
lowkey the whole point: set your max size, get your max size, don't be weird with null pointers and zeros unless you mean it. periodt. π
ok bye bestie, this was ncurses 6.6, dated 2024-03-16, and that's the whole format(3MENU) moment. π«ΆπΈπ¦
π¦ where this page comes from
- ubuntu resolute: ncurses-doc 6.6+20251231-1 Β· MIT/X11
- ubuntu stonking: ncurses-doc 6.6+20260608-2 Β· MIT/X11
- Copyright 2018-2023,2024 Thomas E. Dickey
- Copyright 1998-2015,2016 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms