al_remove_menu_item(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 🌈


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