mark(3MENU)

✨ mark β€” get and set the menu mark string πŸ’…

okay bestie, welcome to the mark(3MENU) glow-up. two lil functions, set_menu_mark and menu_mark, and they're literally the ones in charge of the lil prefix string that tells you which menu item is chosen. it's giving main character energy for your cursor. πŸŽ€


🌸 SYNOPSIS 🌸

#include <menu.h>

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

πŸ’– DESCRIPTION πŸ’–

so back in the day, some terminals were out here with no highlighting and no color capability 😭. like, zero glow. so the menu library had to mark the selected item in a menu with a prefix string instead β€” that's the whole vibe of this feature, and it's honestly iconic.

  • set_menu_mark sets the mark string for the given menu. if you call set_menu_mark with a null menu item, it abolishes the mark string entirely. bye mark 🫢
heads up: changing the length of the mark string for a menu while the menu is posted is likely to produce unhelpful behavior. don't do it, bestie, that's not the moment.
  • the default string is "-" (a dash). calling set_menu_mark with a non-NULL menu argument will change this default. ✨
  • menu_mark returns the menu's mark string (or NULL if there is none). no cap.

πŸ¦‹ RETURN VALUE πŸ¦‹

menu_mark returns a pointer (which may be NULL). it does not set errno. it's chill like that.

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 if you're on something ancient-ancient, this is not the page for you, sorry bestie πŸ™ˆ.


πŸ’œ AUTHORS πŸ’œ

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


⭐ SEE ALSO ⭐

  • ncurses(3NCURSES)
  • menu(3MENU)

and that's the whole page, fr fr β€” get your mark, set your mark, don't resize it mid-post, periodt. πŸ’–

this lil rewrite was brought to you by ncurses 6.6, dated 2024-12-28 β€” the original mark(3MENU) energy, just with way more sparkle 🧚✨

πŸ“¦ where this page comes from