.\" Automatically generated by Pandoc 2.2.1 .\" .TH "al_show_native_message_box" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP al_show_native_message_box \- Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include\ 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 \[lq]OK\[rq] 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 (|). .RS .PP \f[I]Note:\f[] \f[C]buttons\f[] parameter is currently unimplemented on Windows. .RE .PP The flags available are: .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 Display a cancel button alongside the \[lq]OK\[rq] button. Ignored if \f[C]buttons\f[] is not NULL. .RS .RE .TP .B ALLEGRO_MESSAGEBOX_YES_NO Display Yes/No buttons instead of the \[lq]OK\[rq] button. Ignored if \f[C]buttons\f[] is not NULL. .RS .RE .PP al_show_native_message_box(3alleg5) may be called without Allegro being installed. This is useful to report an error during initialisation of 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 All of the remaining parameters must not be NULL. .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] 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 ); \f[] .fi