[gtk+] testgtk: Don't use deprecated functions in progress bar test



commit 27ada645ca24b54501cf4de1e34021cece1f6d76
Author: Benjamin Otte <otte redhat com>
Date:   Thu Apr 10 16:48:13 2014 +0200

    testgtk: Don't use deprecated functions in progress bar test

 tests/testgtk.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 9ed66af..3d77497 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -8236,8 +8236,7 @@ entry_changed (GtkWidget *widget, ProgressData *pdata)
 void
 create_progress_bar (GtkWidget *widget)
 {
-  GtkWidget *action_area, *content_area;
-  GtkWidget *button;
+  GtkWidget *content_area;
   GtkWidget *vbox;
   GtkWidget *vbox2;
   GtkWidget *hbox;
@@ -8280,7 +8279,6 @@ create_progress_bar (GtkWidget *widget)
       pdata->timer = 0;
 
       content_area = gtk_dialog_get_content_area (GTK_DIALOG (pdata->window));
-      action_area = gtk_dialog_get_action_area (GTK_DIALOG (pdata->window));
 
       gtk_window_set_title (GTK_WINDOW (pdata->window), "GtkProgressBar");
       gtk_container_set_border_width (GTK_CONTAINER (pdata->window), 0);
@@ -8376,13 +8374,10 @@ create_progress_bar (GtkWidget *widget)
                        G_CALLBACK (toggle_activity_mode), pdata);
       gtk_grid_attach (GTK_GRID (grid), check, 0, 15, 1, 1);
 
-      button = gtk_button_new_with_label ("close");
-      g_signal_connect_swapped (button, "clicked",
-                               G_CALLBACK (gtk_widget_destroy),
-                               pdata->window);
-      gtk_widget_set_can_default (button, TRUE);
-      gtk_box_pack_start (GTK_BOX (action_area), button, TRUE, TRUE, 0);
-      gtk_widget_grab_default (button);
+      gtk_dialog_add_button (GTK_DIALOG (pdata->window), "Close", GTK_RESPONSE_CLOSE);
+      g_signal_connect (pdata->window, "response",
+                       G_CALLBACK (gtk_widget_destroy),
+                       NULL);
     }
 
   if (!gtk_widget_get_visible (pdata->window))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]