diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-02-26 21:40:09 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-02-26 21:40:09 +0000 |
commit | 1637a9c55b9f4eb3c3e842b8baeb1de4dbf6d62a (patch) | |
tree | ffd7df0b5cfa8b6b3ac1b67ce8e57370f35ac146 /tests | |
parent | 0459484caa2efbabd2fc3fd539c80e3aa42c6b60 (diff) | |
download | gdk-pixbuf-1637a9c55b9f4eb3c3e842b8baeb1de4dbf6d62a.tar.gz |
New convenience API to construct simple text combos, implemented by Damon
Thu Feb 26 22:20:44 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkcomboboxentry.h:
* gtk/gtkcomboboxentry.c (gtk_combo_box_entry_new_text): New
convenience API to construct simple text combos, implemented by
Damon Chaplin.
* tests/testcombo.c: Use gtk_combo_box_entry_new_text.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testcombo.c | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/tests/testcombo.c b/tests/testcombo.c index 485fe1f3f..f5a02c454 100644 --- a/tests/testcombo.c +++ b/tests/testcombo.c @@ -165,33 +165,21 @@ create_blaat () return GTK_TREE_MODEL (store); } -static GtkTreeModel * -create_text_store () +static void +setup_combo_entry (GtkWidget *entry_box) { - GtkTreeIter iter; - GtkListStore *store; - - store = GTK_LIST_STORE (gtk_list_store_new (1, G_TYPE_STRING)); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "dum de dum", -1); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "la la la", -1); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "la la la dum de dum la la la la la la boom de da la la", -1); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "bloop", -1); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "bleep", -1); - - gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, 0, "klaas", -1); - - return GTK_TREE_MODEL (store); + gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box), + "dum de dum"); + gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box), + "la la la"); + gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box), + "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), + "bloop"); + gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box), + "bleep"); + gtk_combo_box_append_text (GTK_COMBO_BOX (entry_box), + "klaas"); } int @@ -302,7 +290,8 @@ main (int argc, char **argv) gtk_container_set_border_width (GTK_CONTAINER (boom), 5); gtk_container_add (GTK_CONTAINER (tmp), boom); - comboboxtext = gtk_combo_box_entry_new_with_model (create_text_store (), 0); + comboboxtext = gtk_combo_box_entry_new_text (); + setup_combo_entry (comboboxtext); gtk_container_add (GTK_CONTAINER (boom), comboboxtext); /* done */ |