attributes(3MENU)

✨ attributes(3MENU) ✨

okay bestie, welcome to attributes(3MENU), a Library calls page that's literally all about making your menus look cute πŸ’… it lives in the ncurses fam and it's giving "glow-up but for terminal menus." let's get into it πŸŽ€


🌸 NAME 🌸

menu_back, menu_fore, menu_grey, menu_pad, set_menu_back, set_menu_fore, set_menu_grey, set_menu_pad β€” color and attribute control for menus 🎨✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <menu.h>

int set_menu_fore(MENU *menu, chtype attr);
chtype menu_fore(const MENU *menu);

int set_menu_back(MENU *menu, chtype attr);
chtype menu_back(const MENU *menu);

int set_menu_grey(MENU *menu, chtype attr);
chtype menu_grey(const MENU *menu);

int set_menu_pad(MENU *menu, int pad);
int menu_pad(const MENU *menu);

πŸ’– DESCRIPTION πŸ’–

so there are four vibes you can set on a menu, and each one has a lil setter + getter duo. iconic behavior honestly πŸ‘‘

  • set_menu_fore sets the foreground attribute of menu. this is the highlight used for selected menu items. and menu_fore returns that foreground attribute. the default? A_REVERSE πŸ’…
  • set_menu_back sets the background attribute of menu. this is the highlight used for selectable (but not currently selected) menu items. menu_back returns the background attribute. the default is A_NORMAL ✨
  • set_menu_grey sets the grey attribute of menu. this is the highlight used for un-selectable menu items in menus that permit more than one selection. menu_grey returns the grey attribute. the default is A_UNDERLINE 🫢
  • set_menu_pad sets the character used to fill the space between the name and description parts of a menu item. menu_pad returns the given menu's pad character. the default is a blank 🌸

🌈 RETURN VALUE 🌈

these routines return one of the following, no cap:

  • E_OK β€” the routine succeeded πŸŽ‰
  • E_SYSTEM_ERROR β€” System error occurred (see errno(3)) 😭
  • E_BAD_ARGUMENT β€” Routine detected an incorrect or out-of-range argument πŸ’€

🧚 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 ancient tech, they simply weren't invited to that party πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

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


⭐ SEE ALSO ⭐

ncurses(3NCURSES) and related pages whose names begin β€œmenu_” for detailed descriptions of the entry points. go read those if you want the deep lore πŸ“šβœ¨


and that's the whole page bestie β€” this was ncurses 6.6, dated 2024-03-16 πŸ’– now go make your menus pretty, you've got this πŸŽ€πŸ’…

πŸ“¦ where this page comes from