menu_attributes(3X)

ok so this is menu_attributes(3X) from the Library calls section, and it's literally all about making your menus look cute β€” colors, attributes, padding, the whole glow-up ✨


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

like... it's giving makeover montage. for menus. no cap.


✨ 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);

see how every setter has a matching getter? setter/gutter energy. iconic. 🫢


πŸ’– DESCRIPTION πŸ’–

okay bestie, there's basically four glow-up levers here and each one has a "set it" and a "read it back" version. let's go one at a time 🧚

set_menu_fore / menu_fore

set_menu_fore sets the foreground attribute of menu. this is the highlight used for selected menu items β€” like the main character of your menu, the one with the spotlight on it πŸ‘‘

menu_fore returns the foreground attribute.

the default is A_REVERSE.

set_menu_back / menu_back

set_menu_back sets the background attribute of menu. this one is the highlight used for selectable (but not currently selected) menu items β€” the supporting cast, cute but not on stage yet πŸŽ€

menu_back returns the background attribute.

the default is A_NORMAL.

set_menu_grey / menu_grey

set_menu_grey sets the grey attribute of menu. this is the highlight used for un-selectable menu items β€” but ONLY in menus that permit more than one selection, iykyk.

menu_grey returns the grey attribute.

the default is A_UNDERLINE.

set_menu_pad / menu_pad

set_menu_pad sets the character used to fill the space between the name and description parts of a menu item. like the little filler dots between the label and the text. the ~aesthetic~ spacing, basically ✨

menu_pad returns the given menu's pad character.

the default is a blank.


πŸ”₯ RETURN VALUE πŸ”₯

these routines return one of the following:

  • E_OK β€” the routine succeeded. we love to see it πŸ’–
  • E_SYSTEM_ERROR β€” a system error occurred (see errno(3)). not the vibe 😭
  • E_BAD_ARGUMENT β€” the routine detected an incorrect or out-of-range argument. bestie... what did you pass in πŸ’€

🌈 PORTABILITY 🌈

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so if you're time-traveling back to old BSD, this page isn't gonna help you, sorry 🫠


πŸ‘‘ AUTHORS πŸ‘‘

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

legends, fr fr 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

curses(3X) and related pages whose names begin β€œmenu_” for detailed descriptions of the entry points.

like, go read those too. the lore is deep πŸ“š


and that's the whole page, bestie β€” this was ncurses 6.6, dated 2024-03-16, signing off πŸ’…βœ¨ stay glossy, keep your attributes set, and remember: a menu without A_REVERSE on its selected item is just... a list. periodt πŸŽ€

πŸ“¦ where this page comes from