1al_show_native_message_box(3L)ibrary Functions Manuaall_show_native_message_box(3)
2
3
4
6 al_show_native_message_box
7
9 #include <allegro5/allegro_native_dialog.h>
10
11 int al_show_native_message_box(ALLEGRO_DISPLAY *display,
12 char const *title, char const *heading, char const *text,
13 char const *buttons, int flags)
14
16 Show a native GUI message box. This can be used for example to display
17 an error message if creation of an initial display fails. The display
18 may be NULL, otherwise the given display is treated as the parent if
19 possible.
20
21 The message box will have a single “OK” button and use the style infor‐
22 mative dialog boxes usually have on the native system. If the buttons
23 parameter is not NULL, you can instead specify the button text in a
24 string, with buttons separated by a vertical bar (|).
25
26 ALLEGRO_MESSAGEBOX_WARN
27 The message is a warning. This may cause a different icon (or
28 other effects).
29
30 ALLEGRO_MESSAGEBOX_ERROR
31 The message is an error.
32
33 ALLEGRO_MESSAGEBOX_QUESTION
34 The message is a question.
35
36 ALLEGRO_MESSAGEBOX_OK_CANCEL
37 Instead of the “OK” button also display a cancel button.
38 Ignored if buttons is not NULL.
39
40 ALLEGRO_MESSAGEBOX_YES_NO
41 Instead of the “OK” button display Yes/No buttons. Ignored if
42 buttons is not NULL.
43
44 al_show_native_message_box(3) may be called without Allegro being
45 installed. This is useful to report an error to initialise Allegro
46 itself.
47
48 Returns:
49
50 · 0 if the dialog window was closed without activating a button.
51
52 · 1 if the OK or Yes button was pressed.
53
54 · 2 if the Cancel or No button was pressed.
55
56 If buttons is not NULL, the number of the pressed button is returned,
57 starting with 1.
58
59 If a message box could not be created then this returns 0, as if the
60 window was dismissed without activating a button.
61
62 Example:
63
64 button = al_show_native_message_box(
65 display,
66 "Warning",
67 "Are you sure?",
68 "If you click yes then you are confirming that \"Yes\""
69 "is your response to the query which you have"
70 "generated by the action you took to open this"
71 "message box.",
72 NULL,
73 ALLEGRO_MESSAGEBOX_YES_NO
74 );
75
76
77
78Allegro reference manual al_show_native_message_box(3)