File: al_show_native_message_box.3

package info (click to toggle)
allegro5 2%3A5.0.10-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,856 kB
  • ctags: 15,948
  • sloc: ansic: 87,540; cpp: 9,693; objc: 3,491; python: 2,057; sh: 829; makefile: 93; perl: 37; pascal: 24
file content (92 lines) | stat: -rw-r--r-- 2,420 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.TH al_show_native_message_box 3 "" "Allegro reference manual"
.SH NAME
.PP
al_show_native_message_box \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#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)
\f[]
.fi
.SH DESCRIPTION
.PP
Show a native GUI message box.
This can be used for example to display an error message if creation of
an initial display fails.
The display may be NULL, otherwise the given display is treated as the
parent if possible.
.PP
The message box will have a single "OK" button and use the style
informative dialog boxes usually have on the native system.
If the \f[C]buttons\f[] parameter is not NULL, you can instead specify
the button text in a string, with buttons separated by a vertical bar
(|).
.TP
.B ALLEGRO_MESSAGEBOX_WARN
The message is a warning.
This may cause a different icon (or other effects).
.RS
.RE
.TP
.B ALLEGRO_MESSAGEBOX_ERROR
The message is an error.
.RS
.RE
.TP
.B ALLEGRO_MESSAGEBOX_QUESTION
The message is a question.
.RS
.RE
.TP
.B ALLEGRO_MESSAGEBOX_OK_CANCEL
Instead of the "OK" button also display a cancel button.
Ignored if \f[C]buttons\f[] is not NULL.
.RS
.RE
.TP
.B ALLEGRO_MESSAGEBOX_YES_NO
Instead of the "OK" button display Yes/No buttons.
Ignored if \f[C]buttons\f[] is not NULL.
.RS
.RE
.PP
al_show_native_message_box(3) may be called without Allegro being
installed.
This is useful to report an error to initialise Allegro itself.
.PP
Returns:
.IP \[bu] 2
0 if the dialog window was closed without activating a button.
.IP \[bu] 2
1 if the OK or Yes button was pressed.
.IP \[bu] 2
2 if the Cancel or No button was pressed.
.PP
If \f[C]buttons\f[] is not NULL, the number of the pressed button is
returned, starting with 1.
.PP
If a message box could not be created then this returns 0, as if the
window was dismissed without activating a button.
.PP
Example:
.IP
.nf
\f[C]
\ \ 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
\ \ );
\f[]
.fi