opts(3MENU)
β¨ opts β the menu options glow-up π
okay bestie, welcome to opts from the menu library, aka section 3MENU of your friendly neighborhood manual pages. this is where you flip the little switches that decide how your menu behaves. lowkey iconic, highkey essential. let's get into it π«Ά
πΈ NAME πΈ
set_menu_opts, menu_opts_on, menu_opts_off, menu_opts β set and get menu options β¨
π 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);
like, copy that include line first or nothing works, that's the vibe check β
π DESCRIPTION π
okay so, four functions, four whole moods:
set_menu_optsβ sets all of the given menu's option bits. and yes, menu option bits can be logically "or"-ed together, so you can stack them like charms on a bracelet. π₯menu_opts_onβ turns on the given option bits and leaves everything else exactly where it was. no notes.menu_opts_offβ turns off the given option bits and leaves everything else alone. it's giving "mind your own business" energy.menu_optsβ just hands you the menu's current option bits. the nosy bestie of the group. π
π¦ the options, bestie π¦
here's the tea β the following options are defined, and all of them are on by default. so if you want chaos, you gotta turn stuff off. periodt.
O_ONEVALUEβ only one item can be selected for this menu. monogamous menu behavior πO_SHOWDESCβ display the item descriptions when the menu is posted. show off a little. β¨O_ROWMAJORβ display the menu in row-major order. rows first, that's the arrangement. πO_IGNORECASEβ ignore the case when pattern-matching.Aandaare literally the same thing here, we don't discriminate. πO_SHOWMATCHβ move the cursor to within the item name while pattern-matching. cursor said "i'm gonna stand right here" πO_NONCYCLICβ don't wrap around next-item and previous-item requests to the other end of the menu. no looping, no sneaky teleporting to the top. it's a one-way street, bestie. π«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. basically it's like "not my department, here, you deal with it" π±οΈ
π RETURN VALUE π
except for menu_opts (she's different, she's the exception, main character energy π), each routine returns one of these:
E_OKβ the routine succeeded. slay. βE_SYSTEM_ERRORβ system error occurred (seeerrno(3)). uh oh. πE_POSTEDβ the menu is already posted. sorry babe, can't do it now. π
π PORTABILITY π
these routines emulate the System V menu library. they were not supported on Version 7 or BSD versions. so if you're kicking it old-school like that, this is not the function set for you, ngl. π°οΈ
π§ AUTHORS π§
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. kings of documentation, we thank them. π«Ά
β SEE ALSO β
ncurses(3NCURSES)menu(3MENU)
fr fr bestie, remember: all those options come on by default, so if your menu is acting a certain way, check which bits you flipped before you blame the library π
mwah, that's the whole page β go forth and configure your menus, you got this π β¨
β ncurses 6.6, dated 2025-01-18, signing off ππ¦πΈ
π¦ 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-2024,2025 Thomas E. Dickey
- Copyright 1998-2015,2016 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms