menu_opts(3X)
π menu_opts(3X) β the one where you set and get menu options
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, pushKEY_MOUSEand theMEVENTdata 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 (seeerrno(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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 1998-2015,2016 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms