al_show_na...essage_box(3)
πΈ NAME πΈ
okay so this is the al_show_na...essage_box(3) page from the Library Functions Manual, bestie, and the function we are hyping up is al_show_native_message_box β Allegro 5 API. β¨
β¨ SYNOPSIS β¨
#include <allegro5/allegro_native_dialog.h>
int al_show_native_message_box(ALLEGRO_DISPLAY *display,
char const *title, char const *heading, char const *text,
char const *buttons, int flags)
π DESCRIPTION π
Show a native GUI message box. This can be used for example to display an error message if creation of an initial display fails. Iconic little emergency-exit energy, no cap. π
The display may be NULL, otherwise the given display is treated as the parent if possible.
The message box will have a single βOKβ button and use the style informative dialog boxes usually have on the native system. If the buttons parameter is not NULL, you can instead specify the button text in a string, with buttons separated by a vertical bar (|). Custom button string moment, iykyk.
Note: the buttons parameter is currently unimplemented on Windows. π
π© The flags available are π©
ALLEGRO_MESSAGEBOX_WARNβ the message is a warning. This may cause a different icon (or other effects).ALLEGRO_MESSAGEBOX_ERRORβ the message is an error.ALLEGRO_MESSAGEBOX_QUESTIONβ the message is a question.ALLEGRO_MESSAGEBOX_OK_CANCELβ display a cancel button alongside the βOKβ button. Ignored ifbuttonsis notNULL.ALLEGRO_MESSAGEBOX_YES_NOβ display Yes/No buttons instead of the βOKβ button. Ignored ifbuttonsis notNULL.
al_show_native_message_box(3) may be called without Allegro being installed. This is useful to report an error during initialisation of Allegro itself. Literally the βhelp, I am not even born yetβ button, bestie. π«Ά
π Returns π
0if the dialog window was closed without activating a button.1if the OK or Yes button was pressed.2if the Cancel or No button was pressed.
If buttons is not NULL, the number of the pressed button is returned, starting with 1.
All of the remaining parameters must not be NULL. Do not test this one, bestie β it is giving undefined chaos. π
If a message box could not be created then this returns 0, as if the window was dismissed without activating a button.
π Example π
int button = al_show_native_message_box(
display,
"Warning",
"Are you sure?",
"If you click yes then you are confirming that \"Yes\" "
"is your response to the query which you have "
"generated by the action you took to open this "
"message box.",
NULL,
ALLEGRO_MESSAGEBOX_YES_NO
);
mwah π β from the Allegro reference manual, al_show_na...essage_box(3); no date is printed on this footer bestie. π«Ά
π¦ 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