summaryrefslogtreecommitdiff
path: root/tests/testcombo.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-04-02 09:51:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-04-02 09:51:01 -0400
commitbf79c8f0df1457fe1f5320c76d3170e2e7217235 (patch)
tree7269bc631f9a34d7f2b55f4202ec6020f58374e2 /tests/testcombo.c
parentb29bbc621090bd3f2fb1a822f8e6e87ed84caba1 (diff)
downloadgtk+-bf79c8f0df1457fe1f5320c76d3170e2e7217235.tar.gz
Add a big combobox test case
I've seen many bugs about long combo box popups getting misplaced or wrongly sized. Time to add a testcase.
Diffstat (limited to 'tests/testcombo.c')
-rw-r--r--tests/testcombo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testcombo.c b/tests/testcombo.c
index f16639cd07..c0a5d471b1 100644
--- a/tests/testcombo.c
+++ b/tests/testcombo.c
@@ -1057,6 +1057,8 @@ main (int argc, char **argv)
GtkTreeIter iter;
GdkRGBA color;
GtkCellArea *area;
+ gchar *text;
+ gint i;
gtk_init (&argc, &argv);
@@ -1431,6 +1433,18 @@ main (int argc, char **argv)
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
gtk_combo_box_set_popup_fixed_width (GTK_COMBO_BOX (combobox), FALSE);
+ tmp = gtk_frame_new ("Looong");
+ gtk_box_pack_start (GTK_BOX (mainbox), tmp, FALSE, FALSE, 0);
+ combobox = gtk_combo_box_text_new ();
+ for (i = 0; i < 200; i++)
+ {
+ text = g_strdup_printf ("Item %d", i);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), text);
+ g_free (text);
+ }
+ gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 53);
+ gtk_container_add (GTK_CONTAINER (tmp), combobox);
+
gtk_widget_show_all (window);
gtk_main ();