Xfce Dialogs

Xfce Dialogs — Common used dialogs to interact with the user.

Synopsis

#include <libxfce4ui/libxfce4ui.h>

GtkWidget *         xfce_message_dialog_new             (GtkWindow *parent,
                                                         const gchar *title,
                                                         const gchar *stock_id,
                                                         const gchar *primary_text,
                                                         const gchar *secondary_text,
                                                         const gchar *first_button_text,
                                                         ...);
GtkWidget *         xfce_message_dialog_new_valist      (GtkWindow *parent,
                                                         const gchar *title,
                                                         const gchar *icon_stock_id,
                                                         const gchar *primary_text,
                                                         const gchar *secondary_text,
                                                         const gchar *first_button_text,
                                                         va_list args);
gint                xfce_message_dialog                 (GtkWindow *parent,
                                                         const gchar *title,
                                                         const gchar *stock_id,
                                                         const gchar *primary_text,
                                                         const gchar *secondary_text,
                                                         const gchar *first_button_text,
                                                         ...);
void                xfce_dialog_show_help               (GtkWindow *parent,
                                                         const gchar *application,
                                                         const gchar *page,
                                                         const gchar *offset);
void                xfce_dialog_show_info               (GtkWindow *parent,
                                                         const gchar *secondary_text,
                                                         const gchar *primary_format,
                                                         ...);
void                xfce_dialog_show_warning            (GtkWindow *parent,
                                                         const gchar *secondary_text,
                                                         const gchar *primary_format,
                                                         ...);
void                xfce_dialog_show_error              (GtkWindow *parent,
                                                         const GError *error,
                                                         const gchar *primary_format,
                                                         ...);
gboolean            xfce_dialog_confirm                 (GtkWindow *parent,
                                                         const gchar *stock_id,
                                                         const gchar *confirm_label,
                                                         const gchar *secondary_text,
                                                         const gchar *primary_format,
                                                         ...);

#define             XFCE_BUTTON_TYPE_MIXED
#define             XFCE_BUTTON_TYPE_PIXBUF

Description

Useful convientent function to interact with the user using a GtkMessageDialog.

Details

xfce_message_dialog_new ()

GtkWidget *         xfce_message_dialog_new             (GtkWindow *parent,
                                                         const gchar *title,
                                                         const gchar *stock_id,
                                                         const gchar *primary_text,
                                                         const gchar *secondary_text,
                                                         const gchar *first_button_text,
                                                         ...);

xfce_message_dialog_new() allows you to easily create Gtk+ message dialogs. It accepts GTK+ stock buttons, mixed buttons (using XFCE_BUTTON_TYPE_MIXED) or buttons with a GdkPixbuf (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].

XFCE_BUTTON_TYPE_MIXED

This allows you to easily create mixed buttons in a dialog. param1 is used for the stock_id, param2 for the label and param3 for the response_id. See also xfce_gtk_button_new_mixed().

XFCE_BUTTON_TYPE_PIXBUF

Creates a button with the GdkPixbuf as button icon. param1 is the GdkPixuf, param2 for the label and param3 for the response_id.

Stock Buttons

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.

To clarify this behaviour see the example below. We create a dialog with two stock buttons, a GdkPixbuf button and a mixed button.

Example 2. Creating a Xfce Message Dialog

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16