menu_opts(3MENU)

okay bestie, so this is one of those library calls pages β€” it lives in the 3MENU manual section, which is the ncurses menu library corner of the world. and ngl, the filename says menu_opts but the actual star of the show is item options ✨ like, it's giving "the title card is lying to you, the plot twist is items."


🌸 NAME 🌸

set_item_opts, item_opts_on, item_opts_off, item_opts β€” set and get menu item options πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <menu.h>

int set_item_opts(ITEM *item, Item_Options opts);
Item_Options item_opts(const ITEM *item);

int item_opts_on(ITEM *item, Item_Options opts);
int item_opts_off(ITEM *item, Item_Options opts);

✨ DESCRIPTION ✨

okay so here's the tea, four little functions, all about the option bits of an item. 🫢

  • set_item_opts β€” this one sets all the given item's option bits. and lowkey the vibe is: menu option bits may be logically "or"-ed together, so you can stack 'em. πŸ”₯
  • item_opts_on β€” turns on the given option bits, and leaves the others alone. no touching, no meddling, just vibes. 🌈
  • item_opts_off β€” turns off the given option bits, and, you guessed it, leaves the others alone. βœ‚οΈ
  • item_opts β€” this one doesn't change anything, it just returns the item's current option bits. it's the friend who reads the group chat and reports back. πŸ‘‘

πŸ’€ the one (1) defined option bit

there is only one defined option bit mask, and its name is O_SELECTABLE.

when this is on, the item may be selected during menu processing. 🎯 and bestie, listen β€” this option defaults to on. it's on by default. it woke up like this. πŸ’…


⭐ RETURN VALUE ⭐

except for item_opts, each routine returns one of the following:

  • E_OK β€” the routine succeeded. slay. πŸŽ‰
  • E_SYSTEM_ERROR β€” system error occurred (see errno(3)). not slay. go check errno(3), babe. 😭

πŸ¦‹ 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, respectfully, no. πŸ™ˆ


πŸ‘‘ AUTHORS πŸ‘‘

Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. legends, fr fr. 🫢


🌈 SEE ALSO 🌈

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

and that's the whole page, bestie. go forth and toggle your item option bits responsibly. πŸ’–

ncurses 6.6 Β· 2025-01-18 Β· mwah, that's the version and the date, sending you off with a little kiss from the 3MENU section πŸŽ€βœ¨

πŸ“¦ where this page comes from