menu_opts(3X)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

okay bestie, so this is a library calls page for menu_opts(3X) from the ncurses fam β€” it's all about flipping option bits on a MENU on and off and reading them back. it's genuinely so useful, you're gonna slay πŸŽ€


✨ NAME ✨

set_menu_opts, menu_opts_on, menu_opts_off, menu_opts β€” the four functions that set and get menu options. that's the whole vibe πŸ’…


✨ SYNOPSIS ✨

#include <menu.h>

int set_menu_opts(MENU *menu, Menu_Options opts);
Menu_Options menu_opts(const MENU *menu);

int menu_opts_on(MENU *menu, Menu_Options opts);
int menu_opts_off(MENU *menu, Menu_Options opts);

✨ DESCRIPTION ✨

okay so there's four functions and they each have a little job, and honestly they're all iconique in their own way 🫢

set_menu_opts sets all the given menu's option bits. and yes β€” menu option bits may be logically "or"-ed together, so you can stack them up with | like a true main character. πŸ‘‘

menu_opts_on turns on the given option bits, and leaves all the others alone. no collateral damage, we love a considerate queen. 🌸

menu_opts_off turns off the given option bits, and leaves the others alone too. same energy, opposite direction. πŸ¦‹

menu_opts just returns the menu's current option bits. that's it, that's the function β€” she reads, she doesn't write. lowkey my fave. ✨

πŸŽ€ the option bits (all of these are on by default, no cap) πŸŽ€

  • O_ONEVALUE β€” only one item can be selected for this menu. one. singular. periodt. πŸ’€
  • O_SHOWDESC β€” display the item descriptions when the menu is posted. the descriptions get their moment to shine. 🌟
  • O_ROWMAJOR β€” display the menu in row-major order. (iykyk πŸ“)
  • O_IGNORECASE β€” ignore the case when pattern-matching. uppercase/lowercase beef = cancelled. πŸ™ˆ
  • O_SHOWMATCH β€” move the cursor to within the item name while pattern-matching. the cursor literally goes where the matching happens. so satisfying. ✨
  • O_NONCYCLIC β€” don't wrap around next-item and previous-item requests to the other end of the menu. no looping back around, bestie, we're not doing the carousel. 🎠
  • O_MOUSE_MENU β€” if the user clicks with the mouse and it does not fall on the currently active menu, push KEY_MOUSE and the MEVENT data back on the queue to allow processing in another part of the calling program. 🐭 like, if they clicked somewhere that isn't your menu's business, you hand it back so somebody else can deal. so polite.

✨ RETURN VALUE ✨

so menu_opts is the exception here β€” the rest of the routines all return one of the following:

  • E_OK β€” the routine succeeded. we love a win. πŸ’–
  • E_SYSTEM_ERROR β€” a system error occurred (see errno(3)). 😭 go check errno, she'll tell you what went down.
  • E_POSTED β€” the menu is already posted. 🫠 like sorry bestie, she's busy being on screen right now.

✨ PORTABILITY ✨

these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so like. know your ancestry. 🧬 (ngl this is the kind of detail that matters if you're porting something ancient πŸ‘‘)


✨ AUTHORS ✨

Juergen Pfeifer. manual pages and adaptation for new curses by Eric S. Raymond. legends, both of them. 🫢


✨ SEE ALSO ✨

  • curses(3X)
  • menu(3X)

🌸 that's the whole page babes, go forth and configure your menus 🌸

this has been <pink>ncurses 6.5</pink>, dated 2025-01-18 β€” mwah, love u, read the man page before you ship it πŸ’‹βœ¨

πŸ“¦ where this page comes from