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_marksets the mark string for the given menu. if you callset_menu_markwith 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). callingset_menu_markwith a non-NULLmenu argument will change this default. β¨ menu_markreturns the menu's mark string (orNULLif 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 (seeerrno(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
- 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-2010,2015 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms