al_set_display_menu(3alleg5)

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

✨ NAME ✨

al_set_display_menu β€” the Allegro 5 API girlies know πŸ’…

This one lives in the Allegro 5 manual, bestie, and it's about giving your display a menu.


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_native_dialog.h>

bool al_set_display_menu(ALLEGRO_DISPLAY *display, ALLEGRO_MENU *menu)

πŸŽ€ DESCRIPTION πŸŽ€

okay so basically: this function associates the menu with the display and shows it. that's the whole vibe. menu goes on display, menu appears, slay. ✨

but here's the plot twist πŸ™ˆ β€” if there was a previous menu associated with the display, it will be destroyed. like, gone. no cap. if you are NOT about that life, you should first remove the menu with al_remove_display_menu(3alleg5). protect your menu, bestie, it's the main character. 🫢

and another thing: if the menu is already attached to a display, it will not be attached to the new display. it's loyal like that. πŸ’€

also if menu is NULL, the current menu will still be destroyed. yes even then. the destruction does not care. 😭

Note: attaching a menu may cause the window as available to your application to be resized! you should listen for a resize event, check how much space was lost, and resize the window accordingly if you want to maintain your window's prior size. like, your window's available area can literally change out from under you, so keep an eye on it. πŸ‘€

Returns true if successful. (and if it's not successful… well, it's not true, iykyk.)


⭐ SINCE ⭐

5.1.0 β€” she's been iconic since 5.1.0, periodt. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page, bestie β€” brought to you by the Allegro reference manual and its al_set_display_menu(3alleg5) era. mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from