summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Dywan <christian@twotoasts.de>2010-10-18 09:10:27 +0200
committerChristian Dywan <christian@twotoasts.de>2010-10-18 09:13:44 +0200
commit6db62c66179fbe0f127b37f5c1dac41a22f304cf (patch)
tree43cd885f9cbce3ff9fc61593e75c0214540bf35d /tests
parentf891c58432a08df37544d5332decedbabe677d6e (diff)
downloadgtk+-6db62c66179fbe0f127b37f5c1dac41a22f304cf.tar.gz
Use new GtkComboBoxEntry in all tests
Diffstat (limited to 'tests')
-rw-r--r--tests/testcombo.c64
-rw-r--r--tests/testgtk.c39
-rw-r--r--tests/testsocket_common.c35
3 files changed, 58 insertions, 80 deletions
diff --git a/tests/testcombo.c b/tests/testcombo.c
index 65e5b5ec91..5afe202f46 100644
--- a/tests/testcombo.c
+++ b/tests/testcombo.c
@@ -940,57 +940,57 @@ capital_animation (gpointer data)
}
static void
-setup_combo_entry (GtkWidget *entry_box)
+setup_combo_entry (GtkComboBoxText *combo)
{
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"dum de dum");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"la la la");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"la la la dum de dum la la la la la la boom de da la la");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"bloop");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"bleep");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas0");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas1");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas2");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas3");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas4");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas5");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas6");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas7");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas8");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas9");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaasa");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaasb");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaasc");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaasd");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaase");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaasf");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas10");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas11");
- gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box),
+ gtk_combo_box_text_append_text (combo,
"klaas12");
}
@@ -1054,7 +1054,6 @@ main (int argc, char **argv)
GtkTreePath *path;
GtkTreeIter iter;
GdkColor color;
- GtkListStore *store;
gtk_init (&argc, &argv);
@@ -1306,15 +1305,8 @@ main (int argc, char **argv)
gtk_container_set_border_width (GTK_CONTAINER (boom), 5);
gtk_container_add (GTK_CONTAINER (tmp), boom);
- store = gtk_list_store_new (1, G_TYPE_STRING);
- comboboxtext = g_object_new (GTK_TYPE_COMBO_BOX,
- "has-entry", TRUE,
- "model", store,
- "entry-text-column", 0,
- NULL);
- g_object_unref (store);
-
- setup_combo_entry (comboboxtext);
+ comboboxtext = gtk_combo_box_text_new_with_entry ();
+ setup_combo_entry (GTK_COMBO_BOX_TEXT (comboboxtext));
gtk_container_add (GTK_CONTAINER (boom), comboboxtext);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index c77f6dfcd9..49a227eb41 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -3951,11 +3951,10 @@ create_entry (GtkWidget *widget)
GtkWidget *sensitive_check;
GtkWidget *progress_check;
GtkWidget *entry;
- GtkComboBox *cb;
+ GtkComboBoxText *cb;
GtkWidget *cb_entry;
GtkWidget *button;
GtkWidget *separator;
- GtkListStore *store;
if (!window)
{
@@ -3993,25 +3992,19 @@ create_entry (GtkWidget *widget)
G_CALLBACK (props_clicked),
entry);
- store = gtk_list_store_new (1, G_TYPE_STRING);
- cb = g_object_new (GTK_TYPE_COMBO_BOX,
- "has-entry", TRUE,
- "model", store,
- "entry-text-column", 0,
- NULL);
- g_object_unref (store);
-
- gtk_combo_box_append_text (cb, "item0");
- gtk_combo_box_append_text (cb, "item0");
- gtk_combo_box_append_text (cb, "item1 item1");
- gtk_combo_box_append_text (cb, "item2 item2 item2");
- gtk_combo_box_append_text (cb, "item3 item3 item3 item3");
- gtk_combo_box_append_text (cb, "item4 item4 item4 item4 item4");
- gtk_combo_box_append_text (cb, "item5 item5 item5 item5 item5 item5");
- gtk_combo_box_append_text (cb, "item6 item6 item6 item6 item6");
- gtk_combo_box_append_text (cb, "item7 item7 item7 item7");
- gtk_combo_box_append_text (cb, "item8 item8 item8");
- gtk_combo_box_append_text (cb, "item9 item9");
+ cb = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
+
+ gtk_combo_box_text_append_text (cb, "item0");
+ gtk_combo_box_text_append_text (cb, "item0");
+ gtk_combo_box_text_append_text (cb, "item1 item1");
+ gtk_combo_box_text_append_text (cb, "item2 item2 item2");
+ gtk_combo_box_text_append_text (cb, "item3 item3 item3 item3");
+ gtk_combo_box_text_append_text (cb, "item4 item4 item4 item4 item4");
+ gtk_combo_box_text_append_text (cb, "item5 item5 item5 item5 item5 item5");
+ gtk_combo_box_text_append_text (cb, "item6 item6 item6 item6 item6");
+ gtk_combo_box_text_append_text (cb, "item7 item7 item7 item7");
+ gtk_combo_box_text_append_text (cb, "item8 item8 item8");
+ gtk_combo_box_text_append_text (cb, "item9 item9");
cb_entry = gtk_bin_get_child (GTK_BIN (cb));
gtk_entry_set_text (GTK_ENTRY (cb_entry), "hello world \n\n\n foo");
@@ -5576,7 +5569,7 @@ screen_display_check (GtkWidget *widget, ScreenDisplaySelection *data)
break;
}
if (!found)
- gtk_combo_box_append_text (GTK_COMBO_BOX (data->combo), display_name);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (data->combo), display_name);
new_screen = gdk_display_get_default_screen (display);
}
}
@@ -5646,7 +5639,7 @@ create_display_screen (GtkWidget *widget)
"only one screen on the current display");
gtk_widget_set_sensitive (radio_scr, FALSE);
}
- combo_dpy = gtk_combo_box_text_new ();
+ combo_dpy = gtk_combo_box_text_new_with_entry ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dpy), "diabolo:0.0");
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_dpy))),
"<hostname>:<X Server Num>.<Screen Num>");
diff --git a/tests/testsocket_common.c b/tests/testsocket_common.c
index ababbf2b78..0023909f84 100644
--- a/tests/testsocket_common.c
+++ b/tests/testsocket_common.c
@@ -132,28 +132,21 @@ add_buttons (GtkWidget *widget, GtkWidget *box)
static GtkWidget *
create_combo (void)
{
- GtkComboBox *combo;
+ GtkComboBoxText *combo;
GtkWidget *entry;
- GtkListStore *store;
-
- store = gtk_list_store_new (1, G_TYPE_STRING);
- combo = g_object_new (GTK_TYPE_COMBO_BOX,
- "has-entry", TRUE,
- "model", store,
- "entry-text-column", 0,
- NULL);
- g_object_unref (store);
-
- 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");
+
+ combo = GTK_COMBO_BOX_TEXT (gtk_combo_box_text_new_with_entry ());
+
+ gtk_combo_box_text_append_text (combo, "item0");
+ gtk_combo_box_text_append_text (combo, "item1 item1");
+ gtk_combo_box_text_append_text (combo, "item2 item2 item2");
+ gtk_combo_box_text_append_text (combo, "item3 item3 item3 item3");
+ gtk_combo_box_text_append_text (combo, "item4 item4 item4 item4 item4");
+ gtk_combo_box_text_append_text (combo, "item5 item5 item5 item5 item5 item5");
+ gtk_combo_box_text_append_text (combo, "item6 item6 item6 item6 item6");
+ gtk_combo_box_text_append_text (combo, "item7 item7 item7 item7");
+ gtk_combo_box_text_append_text (combo, "item8 item8 item8");
+ gtk_combo_box_text_append_text (combo, "item9 item9");
entry = gtk_bin_get_child (GTK_BIN (combo));
gtk_entry_set_text (GTK_ENTRY (entry), "hello world");