menu_mark(3X)

okay bestie, pull up a chair because we're talking about the menu library's literal Library calls today and honestly? it's giving underrated icon behavior πŸ’…


πŸŽ€ NAME πŸŽ€

set_menu_mark, menu_mark β€” get and set the menu mark string, no cap ✨


🌸 SYNOPSIS 🌸

#include <menu.h>

int set_menu_mark(MENU *menu, const char *mark);
const char *menu_mark(const MENU *menu);

πŸ’– DESCRIPTION πŸ’–

so here's the vibe: back in the day, older terminals didn't have highlighting or color capability 😭 and like, how is anyone supposed to see which menu item is selected?? so the menu library marks selected items in a menu with a prefix string. that's it. that's the whole girlboss strategy. 🫢

the function set_menu_mark sets the mark string for the given menu. and listen β€” calling set_menu_mark with a null menu item will abolish the mark string entirely. gone. bye. πŸ¦‹

⚠️ note that changing the length of the mark string for a menu while the menu is posted is likely to produce unhelpful behavior. not me warning you about undefined-ish chaos πŸ‘€ just don't do it bestie.

the default string is "-" (a dash). iconic, minimal, classic. calling set_menu_mark with a non-NULL menu argument will change this default. ✨

the function menu_mark returns the menu's mark string (or NULL if there is none). simple as that, fr fr. πŸ’œ


🌈 RETURN VALUE 🌈

the function menu_mark returns a pointer (which may be NULL). it does not set errno. 🧚

the function set_menu_mark may return the following error codes:

  • E_OK β€” the routine succeeded. slay! πŸ‘‘
  • E_BAD_ARGUMENT β€” routine detected an incorrect or out-of-range argument. 😭
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). πŸ’€

πŸ¦‹ PORTABILITY πŸ¦‹

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so like, if you're on ancient BSD... it's giving nothing, sorry babe πŸ™ˆ


πŸ’œ AUTHORS πŸ’œ

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends, honestly. ✨


πŸ“ SEE ALSO πŸ“

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

and that's the whole page bestie, mwah πŸ’– this was the ncurses 6.6 era of these docs, dated 2024-12-28, so go forth and mark your menus with main character energy 🌸✨

πŸ“¦ where this page comes from