al_remove_menu_item(3alleg5)
π al_remove_menu_item π
okay bestie, welcome to the Allegro 5 API corner of the manual, where we delete menu items and feel cute doing it π
β¨ NAME β¨
al_remove_menu_item β the Allegro 5 API function that yeets an item out of a menu, no cap ποΈβ¨
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_native_dialog.h>
bool al_remove_menu_item(ALLEGRO_MENU *menu, int pos)
so you include that header, and you get this lil bool-returning function. iconic signature tbh π
π¦ DESCRIPTION π¦
okay so here's the tea β β al_remove_menu_item removes the specified item from the menu and destroys it. gone. poof. π
and the way that it doesn't stop thereβ¦ if the item you're removing contains a sub-menu, that sub-menu gets destroyed too π the whole thing, sub-menu and all, is gone.
heads up bestie: any references to it are invalidated. like, do not touch them after this. they're ghosts now π»
so if you actually want to keep that sub-menu alive, you should first make a copy with al_clone_menu(3alleg5). clone it first, then delete. that's the move π«Ά
the good news? this is safe to call on a menu that is currently being displayed β¨ so you don't have to close anything down first, it just works while it's on screen.
and it returns true if an item was actually removed. slay β
β SINCE β
5.1.0 β she's been here since 5.1.0, a true veteran π
π SEE ALSO π
al_append_menu_item(3alleg5)β for adding items instead of removing them πal_insert_menu_item(3alleg5)β for sliding an item into a specific spot π§al_destroy_menu(3alleg5)β for when the whole menu has to go π
and that's the whole page, bestie!! this was the Allegro reference manual doing its thing, al_remove_menu_item, 5.1.0 energy, iykyk π
π¦ 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