message_dialog_new allows you to easily create Gtk+ message dialogs.
It accepts GTK+ stock buttons (deprecated), mixed buttons (using XFCE_BUTTON_TYPE_MIXED) or buttons with a Pixbuf (using XFCE_BUTTON_TYPE_PIXBUF).
The buttons are defined by first_button_text and the next arguments in the following format type, param1
[, param2, param3].
<variablelist> <varlistentry> <term><varname>XFCE_BUTTON_TYPE_MIXED</varname></term> <listitem
> <para> This allows you to easily create mixed buttons in a dialog. param1 is used for the icon name,
param2 for the label and param3 for the response_id. See also
gtk_button_new_mixed. </para> </listitem> </varlistentry>
<varlistentry> <term><varname>XFCE_BUTTON_TYPE_PIXBUF</varname></term> <listitem> <para>
Creates a button with the Pixbuf as button icon. param1 is the
Pixbuf, param2 for the label and param3 for the
response_id. </para> </listitem> </varlistentry> <varlistentry> <term>Stock Buttons</term> <
listitem> <para> When the variables above were not matched, the button type will be a stock button. type will be
the stock id, param1 is used for the response_id. </para> </listitem> </varlistentry> </variablelist
>
To clarify this behaviour see the example below. We create a dialog with two stock buttons, a Pixbuf button and a mixed button.
<example> <title>Creating a Xfce Message Dialog</title> <programlisting> GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 24, 24);
GtkWidget *dialog = xfce_message_dialog (parent, "Question", GTK_STOCK_DIALOG_QUESTION, "There are unsaved modifications", "The menu has been modified, do you want to save it before quitting?", GTK_STOCK_SAVE, GTK_RESPONSE_YES, XFCE_BUTTON_TYPE_MIXED, "edit-delete", _( "Forget modifications"), GTK_RESPONSE_APPLY, XFCE_BUTTON_TYPE_PIXBUF, pixbuf, "Quit", GTK_RESPONSE_NO, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, NULL);
g_object_unref (G_OBJECT (pixbuf)); </programlisting> </example>
The caller is responsible for destroying the dialog with destroy when it is no longer required.
| parent |
transient parent of the dialog, or null. |
| title |
title of the dialog, or null. |
| stock_id |
gtk stock icon name to show in the dialog. |
| primary_text |
primary text shown in large bold font. |
| secondary_text |
secondary text shown in normal font. |
| ... |
null terminated list of parameters. |
| first_button_text |
text for the first button. |
|
A new MessageDialog. |