diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-03-18 19:49:10 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-03-18 19:53:36 -0400 |
commit | f5dc69ab8e23f1d26b18066d5cc7a4b15b44431b (patch) | |
tree | f0a2ae00fbbee97ac50422f320e1acd5ae0c99e8 /tests | |
parent | 4ee775ebf974678ccca617e2ce3e0764f6e4d9fd (diff) | |
download | gtk+-f5dc69ab8e23f1d26b18066d5cc7a4b15b44431b.tar.gz |
Add at testcase for a message dialog with icon
Icons in message dialogs may be deprecated, but we still need
to place them properly, so add a testcase.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testdialog.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/testdialog.c b/tests/testdialog.c index e1c2f7c69d..6726263321 100644 --- a/tests/testdialog.c +++ b/tests/testdialog.c @@ -20,6 +20,29 @@ show_message_dialog1 (GtkWindow *parent) } static void +show_message_dialog1a (GtkWindow *parent) +{ + GtkWidget *dialog; + GtkWidget *image; + + dialog = GTK_WIDGET (gtk_message_dialog_new (parent, + GTK_DIALOG_MODAL| + GTK_DIALOG_DESTROY_WITH_PARENT| + GTK_DIALOG_USE_HEADER_BAR, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + "The system network services are not compatible with this version.")); + + image = gtk_image_new_from_icon_name ("computer-fail", GTK_ICON_SIZE_DIALOG); + gtk_widget_show (image); + gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image); + + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); +} + +static void show_message_dialog2 (GtkWindow *parent) { GtkWidget *dialog; @@ -300,6 +323,11 @@ main (int argc, char *argv[]) gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); + button = gtk_button_new_with_label ("Message with icon"); + g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_message_dialog1a), window); + gtk_widget_show (button); + gtk_container_add (GTK_CONTAINER (box), button); + button = gtk_button_new_with_label ("Confirmation dialog"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_message_dialog2), window); gtk_widget_show (button); |