[gtk+/gtk-2-90] Do not use deprecated GtkNoteBook api in testgtk



commit d9248795b5d424aef574db84daf1d3ee138430a5
Author: Javier Jardón <jjardon gnome org>
Date:   Mon Apr 26 05:26:42 2010 +0200

    Do not use deprecated GtkNoteBook api in testgtk

 tests/testgtk.c |   52 ++++++----------------------------------------------
 1 files changed, 6 insertions(+), 46 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index eedadb3..4395ff6 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -24,7 +24,6 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#undef GTK_DISABLE_DEPRECATED
 
 #include "config.h"
 
@@ -6700,38 +6699,17 @@ page_switch (GtkWidget *widget, GtkNotebookPage *page, gint page_num)
 static void
 tab_fill (GtkToggleButton *button, GtkWidget *child)
 {
-  gboolean expand;
-  GtkPackType pack_type;
-
-  gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-					&expand, NULL, &pack_type);
-  gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-				      expand, button->active, pack_type);
+  gtk_container_child_set (GTK_CONTAINER (sample_notebook), child,
+                           "tab-fill", gtk_toggle_button_get_active (button),
+                           NULL);
 }
 
 static void
 tab_expand (GtkToggleButton *button, GtkWidget *child)
 {
-  gboolean fill;
-  GtkPackType pack_type;
-
-  gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-					NULL, &fill, &pack_type);
-  gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-				      button->active, fill, pack_type);
-}
-
-static void
-tab_pack (GtkToggleButton *button, GtkWidget *child)
-	  
-{ 
-  gboolean expand;
-  gboolean fill;
-
-  gtk_notebook_query_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-					&expand, &fill, NULL);
-  gtk_notebook_set_tab_label_packing (GTK_NOTEBOOK (sample_notebook), child,
-				      expand, fill, button->active);
+  gtk_container_child_set (GTK_CONTAINER (sample_notebook), child,
+                           "tab-expand", gtk_toggle_button_get_active (button),
+                           NULL);
 }
 
 static void
@@ -6775,11 +6753,6 @@ create_pages (GtkNotebook *notebook, gint start, gint end)
       g_signal_connect (button, "toggled",
 			G_CALLBACK (tab_expand), child);
 
-      button = gtk_check_button_new_with_label ("Pack end");
-      gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 5);
-      g_signal_connect (button, "toggled",
-			G_CALLBACK (tab_pack), child);
-
       button = gtk_button_new_with_label ("Hide Page");
       gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 5);
       g_signal_connect_swapped (button, "clicked",
@@ -6895,13 +6868,6 @@ notebook_popup (GtkToggleButton *button,
 }
 
 static void
-notebook_homogeneous (GtkToggleButton *button,
-		      GtkNotebook     *notebook)
-{
-  g_object_set (notebook, "homogeneous", button->active, NULL);
-}
-
-static void
 create_notebook (GtkWidget *widget)
 {
   static GtkWidget *window = NULL;
@@ -6966,12 +6932,6 @@ create_notebook (GtkWidget *widget)
 			G_CALLBACK (notebook_popup),
 			sample_notebook);
 
-      button = gtk_check_button_new_with_label ("homogeneous tabs");
-      gtk_box_pack_start (GTK_BOX (box2), button, TRUE, FALSE, 0);
-      g_signal_connect (button, "clicked",
-			G_CALLBACK (notebook_homogeneous),
-			sample_notebook);
-
       box2 = gtk_hbox_new (FALSE, 5);
       gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
       gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);



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