diff options
Diffstat (limited to 'gtk/gtkdialog.c')
-rw-r--r-- | gtk/gtkdialog.c | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index ed8bc082a9..806f8ed9d7 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -100,32 +100,36 @@ * * An example for simple GtkDialog usage: * |[<!-- language="C" --> - * /* Function to open a dialog box displaying the message provided. */ + * /* Function to open a dialog box with a message */ * void - * quick_message (gchar *message) + * quick_message (GtkWindow *parent, gchar *message) * { - * GtkWidget *dialog, *label, *content_area; - * - * /* Create the widgets */ - * dialog = gtk_dialog_new_with_buttons ("Message", - * main_application_window, - * GTK_DIALOG_DESTROY_WITH_PARENT, - * _("_OK"), - * GTK_RESPONSE_NONE, - * NULL); - * content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); - * label = gtk_label_new (message); - * - * /* Ensure that the dialog box is destroyed when the user responds */ - * g_signal_connect_swapped (dialog, - * "response", - * G_CALLBACK (gtk_widget_destroy), - * dialog); - * - * /* Add the label, and show everything we’ve added to the dialog */ - * - * gtk_container_add (GTK_CONTAINER (content_area), label); - * gtk_widget_show_all (dialog); + * GtkWidget *dialog, *label, *content_area; + * GtkDialogFlags flags; + * + * /* Create the widgets */ + * flags = GTK_DIALOG_DESTROY_WITH_PARENT; + * dialog = gtk_dialog_new_with_buttons ("Message", + * parent, + * flags, + * _("_OK"), + * GTK_RESPONSE_NONE, + * NULL); + * content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + * label = gtk_label_new (message); + * + * /* Ensure that the dialog box is destroyed when the user + * responds */ + * + * g_signal_connect_swapped (dialog, + * "response", + * G_CALLBACK (gtk_widget_destroy), + * dialog); + * + * /* Add the label, and show everything we’ve added */ + * + * gtk_container_add (GTK_CONTAINER (content_area), label); + * gtk_widget_show_all (dialog); * } * ]| * @@ -860,14 +864,16 @@ gtk_dialog_new_empty (const gchar *title, * * Here’s a simple example: * |[<!-- language="C" --> - * GtkWidget *dialog = gtk_dialog_new_with_buttons ("My dialog", - * main_app_window, - * GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - * _("_OK"), - * GTK_RESPONSE_ACCEPT, - * _("_Cancel"), - * GTK_RESPONSE_REJECT, - * NULL); + * GtkWidget *dialog; + * GtkDialogFlags flags = GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT; + * dialog = gtk_dialog_new_with_buttons ("My dialog", + * main_app_window, + * flags, + * _("_OK"), + * GTK_RESPONSE_ACCEPT, + * _("_Cancel"), + * GTK_RESPONSE_REJECT, + * NULL); * ]| * * Return value: a new #GtkDialog |