mitem_value(3X)
π mitem_value(3X) π
okay bestie, gather round, because today we're talking about mitem_value(3X) β the library call that's all about setting and getting your menu item values. two lil functions, set_item_value and item_value, and they're literally the moment your menu stops being a one-trick pony. β¨
πΈ NAME πΈ
set_item_value, item_value β set and get menu item values π
π¦ SYNOPSIS π¦
#include <menu.h>
int set_item_value(ITEM *item, bool value);
bool item_value(const ITEM *item);
no cap, that's the whole thing. two lines. iconic. π
π DESCRIPTION π
okay so here's the tea. by default a menu is like... one of those friend groups where only one person gets to talk at a time. turn off the menu option O_ONEVALUE (you can do that with set_menu_opts or menu_opts_off β go peek at menu_opts(3X), it's giving lore) and suddenly the menu becomes multi-valued, which means more than one item may simultaneously be selected. yes bestie, MULTIPLE. we contain multitudes. π«Ά
so in a multi-valued menu, you get to use set_item_value to select the given menu item β that's the second argument being TRUE β or deselect it β second argument FALSE. that's it, that's the whole vibe. you point at an item, you say yes or no, the menu listens. main character energy fr fr. π
β RETURN VALUE β
the function set_item_value returns one of these bad boys:
E_OKβ the routine succeeded. slay. we ate. π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 emulate the System V menu library. they were not supported on Version 7 or BSD versions β so if you're time-traveling back to those, sorry babes, you're on your own. π
π AUTHORS π
Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. kings. π
π SEE ALSO π
curses(3X)menu(3X)
lowkey reminder bestie:item_valuegets,set_item_valuesets. don't mix them up or the vibe check will fail. π
and that's the page!! brought to you by ncurses 6.6, dated 2024-03-16 β mwah, tysm for reading, now go forth and select multiple items at once like the multi-valued icon you are π§π β¨
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- 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