]> Pileus Git - ~andy/gtk/commitdiff
Use GtkComboBox instead of GtkCombo in testsocket
authorChristian Dywan <christian@twotoasts.de>
Wed, 31 Mar 2010 15:24:50 +0000 (17:24 +0200)
committerJavier Jardón <jjardon@gnome.org>
Sun, 2 May 2010 23:51:22 +0000 (01:51 +0200)
tests/testsocket.c
tests/testsocket_common.c

index 1493215b3b274906b0efd8e3371b234f0dffcbdb..657fa8af80ba6fe2f821eb7a60b52ba3e3dd8517 100644 (file)
@@ -19,8 +19,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#undef GTK_DISABLE_DEPRECATED
-
 #include "config.h"
 #include <gtk/gtk.h>
 
index 148b03320a116cd0176e5c826fc2aed28858b861..d2e1d2f80450a1c269fc4e9bd2a0091b41ae7064 100644 (file)
@@ -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);
 }