do_menu(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

πŸ’– do_menu β€” NAME πŸŽ€

do_menu β€” displays and animates a popup menu. It's part of the Allegro game programming library, bestie. πŸ¦‹


✨ SYNOPSIS ✨

#include <allegro.h>

int do_menu(MENU *menu, int x, int y);

🌸 DESCRIPTION 🌸

Okay so listen. do_menu displays and animates a popup menu right at the screen coordinates you hand it β€” that's your x and your y, bestie. πŸ’…

Lowkey important: those coordinates will be adjusted if the menu doesn't entirely fit on the screen. The function is not gonna let your menu hang off the edge, she's got main character energy and she fits herself in. πŸ‘‘

Then she returns the index of the menu item that was selected β€” or -1 if the menu was cancelled. Like, if your user noped out, you get -1. Periodt. πŸ™ˆ

🚨 Real talk though: the return value cannot indicate selection from child menus. So if you want multi-level menus, you are going to have to use the callback functions. No cap, there is no other way. 😭

🫢 SEE ALSO 🫢

Go read those too, iykyk. πŸ’œ


And that's the whole vibe, angel β€” this was the do_menu(3) page out of the Allegro manual, brought to you by Allegro version 4.4.3. Slay, go build a menu. πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from