alert(3alleg4)
π alert β bestie edition π
okay so real talk: this is a page from the Allegro manual (3alleg4), and it's all about that lil popup box that goes ding and tells you something. slay.
β¨ NAME β¨
alert β pops up an alert box like "hey girl, heads up". it's part of the Allegro game programming library π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int alert(const char *s1, *s2, *s3, const char *b1, *b2, int c1, c2);
π¦ DESCRIPTION π¦
so basically it displays a popup alert box, and this box is giving main character energy β it holds three lines of text (s1-s3), and it comes with either one or two buttons. your choice, diva.
the text on those buttons gets passed in b1 and b2 β and heads up, b2 may be NULL if you're only doing the one-button thing. no shame in being lowkey.
the keyboard shortcuts? those go in c1 and c2, passed as ASCII value. iykyk.
here's an example that's literally iconic:
if (!exists(CONFIG_FILE))
alert(CONFIG_FILE, "not found.", "Using defaults.",
"&Continue", NULL, 'c', 0);
π RETURN VALUE π
it returns 1 or 2, depending on which button got clicked. simple as that, no cap.
β οΈ but wait β if the alert gets dismissed by pressing ESC when ESC is not one of the keyboard shortcuts, it treats that as a click on the second button. and fr fr that makes sense, it's consistent with the common "Ok", "Cancel" alert. so ESC = cancel, periodt.
π SEE ALSO π
go read those next bestie, they ate π
this lil page came straight from the Allegro manual, version 4.4.3 β the 3alleg4 section, to be exact. mwah, bye πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms