al_popup_menu(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– NAME πŸ’–

al_popup_menu(3) β€” this is the Allegro 5 API page for al_popup_menu. It lives in the Library Functions Manual, and bestie, it’s giving β€œcontext menu but make it official.” πŸ’…


✨ SYNOPSIS ✨

#include <allegro5/allegro_native_dialog.h>

bool al_popup_menu(ALLEGRO_MENU *popup, ALLEGRO_DISPLAY *display)

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so al_popup_menu displays a context menu right next to the mouse cursor. Slay. The menu must have been created with al_create_popup_menu(3) first β€” no improvising, bestie.

It generates events just like a regular display menu does. Iconic behavior, honestly. Also possible: the menu gets canceled without any selection being made. It happens, no cap. 😭

The display parameter indicates which window the menu is associated with β€” that matters when you process the menu click event β€” but it does not actually affect where the menu is located on the screen. So it’s not moving the menu around, it’s just telling you which window it’s tied to. Periodt. πŸ’…

Returns true if the context menu was displayed. 🫢

Note: On Linux this function will fail if any of the mouse keys are held down. I.e. it will only reliably work if you handle it in ALLEGRO_MOUSE_BUTTON_UP events and even then only if that event corresponds to the final mouse button that was pressed. This is the caveat, bestie β€” read it twice. πŸ’€

πŸ‘‘ SINCE πŸ‘‘

5.1.0 β€” this one has been around since 5.1.0. Vintage but still cute. ✨


🌸 SEE ALSO 🌸


πŸ’– That’s the whole page, bestie! Signing off from the Allegro reference manual β€” source/version: Allegro reference manual; date: literally not listed on the page, so I’m not inventing one, no cap πŸ’€. al_popup_menu(3) out! 🫢

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms