menu_value(3MENU)
π menu_value β bestie edition π
ok so we're in the 3MENU manual, library calls section, and today's topic is set_item_value and item_value β the little duo that sets and gets menu item values. yes they're a pair. yes they slay. let's go π
β¨ NAME β¨
set_item_value, item_value β set and get menu item values
like. that's it. that's the whole job. one sets, one gets, they're giving complementary energy π«Ά
πΈ SYNOPSIS πΈ
#include <menu.h>
int set_item_value(ITEM *item, bool value);
bool item_value(const ITEM *item);
π¦ DESCRIPTION π¦
okay so here's the tea β
by default a menu is a "pick one, bestie" situation β but if you turn off the menu option O_ONEVALUE (you can do that with set_menu_opts or menu_opts_off, go peek at opts(3MENU) if you wanna know more), the menu goes multi-valued β¨ which literally means more than one item may simultaneously be selected. yes. multiple. at the same time. the menu is poly now, we love that for it π
and in a multi-valued menu, you can use set_item_value to:
- select the given menu item β second argument is
TRUEβ - deselect it β second argument is
FALSEβ
that's the whole vibe check. TRUE = in, FALSE = out, no cap π
π RETURN VALUE π
set_item_value comes back with one of these, and honestly they're each giving a little something:
E_OKβ the routine succeeded. periodt. iconic. no notes πE_SYSTEM_ERRORβ a system error occurred (go checkerrno(3), bestie, it knows what happened π)E_REQUEST_DENIEDβ the menu driver could not process the request. it said no. respectfully. π
π PORTABILITY π
these routines are emulating the System V menu library β so they're doing a little vintage cosplay π§
they were not supported on Version 7 or BSD versions. like, at all. nope. not invited to that party π
π AUTHORS π
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond.
thank you for your service, kings π
π SEE ALSO π
ncurses(3NCURSES)menu(3MENU)
and that's the whole page, bestie π this was ncurses 6.6, dated 2024-03-16, and it ate, fr fr β¨ go forth and select multiple things simultaneously, you've earned it ππ¦πΈ
π¦ 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