[gtk+/gtk-2-90] Use GtkComboBox instead of GtkCombo in testsocket



commit db76768cccace66e033ac5f720fd0538758c143c
Author: Christian Dywan <christian twotoasts de>
Date:   Wed Mar 31 17:24:50 2010 +0200

    Use GtkComboBox instead of GtkCombo in testsocket

 tests/testsocket.c        |    2 --
 tests/testsocket_common.c |   39 ++++++++++++++++++---------------------
 2 files changed, 18 insertions(+), 23 deletions(-)
---
diff --git a/tests/testsocket.c b/tests/testsocket.c
index 1493215..657fa8a 100644
--- a/tests/testsocket.c
+++ b/tests/testsocket.c
@@ -19,8 +19,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#undef GTK_DISABLE_DEPRECATED
-
 #include "config.h"
 #include <gtk/gtk.h>
 
diff --git a/tests/testsocket_common.c b/tests/testsocket_common.c
index 148b033..d2e1d2f 100644
--- a/tests/testsocket_common.c
+++ b/tests/testsocket_common.c
@@ -18,8 +18,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#undef GTK_DISABLE_DEPRECATED
-
 #include "config.h"
 #include <gtk/gtk.h>
 #if defined (GDK_WINDOWING_X11)
@@ -134,25 +132,24 @@ add_buttons (GtkWidget *widget, GtkWidget *box)
 static GtkWidget *
 create_combo (void)
 {
-  GList *cbitems;
-  GtkCombo *combo;
-
-  cbitems = NULL;
-  cbitems = g_list_append (cbitems, "item0");
-  cbitems = g_list_append (cbitems, "item1 item1");
-  cbitems = g_list_append (cbitems, "item2 item2 item2");
-  cbitems = g_list_append (cbitems, "item3 item3 item3 item3");
-  cbitems = g_list_append (cbitems, "item4 item4 item4 item4 item4");
-  cbitems = g_list_append (cbitems, "item5 item5 item5 item5 item5 item5");
-  cbitems = g_list_append (cbitems, "item6 item6 item6 item6 item6");
-  cbitems = g_list_append (cbitems, "item7 item7 item7 item7");
-  cbitems = g_list_append (cbitems, "item8 item8 item8");
-  cbitems = g_list_append (cbitems, "item9 item9");
-
-  combo = GTK_COMBO (gtk_combo_new ());
-  gtk_combo_set_popdown_strings (combo, cbitems);
-  gtk_entry_set_text (GTK_ENTRY (combo->entry), "hello world");
-  gtk_editable_select_region (GTK_EDITABLE (combo->entry), 0, -1);
+  GtkComboBox *combo;
+  GtkWidget *entry;
+
+  combo = GTK_COMBO_BOX (gtk_combo_box_entry_new_text ());
+  gtk_combo_box_append_text (combo, "item0");
+  gtk_combo_box_append_text (combo, "item1 item1");
+  gtk_combo_box_append_text (combo, "item2 item2 item2");
+  gtk_combo_box_append_text (combo, "item3 item3 item3 item3");
+  gtk_combo_box_append_text (combo, "item4 item4 item4 item4 item4");
+  gtk_combo_box_append_text (combo, "item5 item5 item5 item5 item5 item5");
+  gtk_combo_box_append_text (combo, "item6 item6 item6 item6 item6");
+  gtk_combo_box_append_text (combo, "item7 item7 item7 item7");
+  gtk_combo_box_append_text (combo, "item8 item8 item8");
+  gtk_combo_box_append_text (combo, "item9 item9");
+
+  entry = gtk_bin_get_child (GTK_BIN (combo));
+  gtk_entry_set_text (GTK_ENTRY (entry), "hello world");
+  gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
 
   return GTK_WIDGET (combo);
 }



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