al_toggle_menu_item_flags(3alleg5)
π al_toggle_menu_item_flags β the Allegro 5 API page, bestie edition π
okay so this is a page from the Allegro reference manual (that's the 3alleg5 manual, iykyk) and we're talking about one little function that flips menu item flags like a light switch. sit down, get comfy, we're doing this π
β¨ NAME β¨
al_toggle_menu_item_flags β Allegro 5 API
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_native_dialog.h>
int al_toggle_menu_item_flags(ALLEGRO_MENU *menu, int pos, int flags)
π¦ DESCRIPTION π¦
So basically, this function toggles the specified menu item's flags. Flip flip flip π
Wanna know what flags even exist to toggle? Go read al_insert_menu_item(3alleg5) β that's where all the available flags get described. not me sending you on a lil side quest but it's necessary fr fr.
Now here's the part you need to clock: it returns a bitfield of only the specified flags that are set after the toggle. Read that again, bestie. If you didn't toggle a flag, it will not be returned, even if it happens to be set. The return value is not "all the flags that are set," it's "the ones you named, and only the ones that ended up set after the flip." the way that's so specific of it π
And if the id is invalid, it returns -1. that's your little "nope, didn't work" signal π©
π SINCE π
5.1.0
[Unstable API]: Redundant with al_get/set_menu_item_flags.
like... yeah. it's giving "we have getters and setters at home." but it's here, it exists, and it's marked unstable, so don't build your whole personality on it, okay? π
π SEE ALSO π
that's the whole page, gorgeous π«Ά it lives in the Allegro reference manual under the name al_toggle_menu_item_flags(3alleg5), and yes the footer says the same thing because manpages love to repeat themselves. go toggle some flags, you absolute icon βππ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms