summaryrefslogtreecommitdiff
path: root/tests/treestoretest.c
diff options
context:
space:
mode:
authorKristian Rietveld <kristian@planet.nl>2001-10-24 18:36:50 +0000
committerKristian Rietveld <kristian@src.gnome.org>2001-10-24 18:36:50 +0000
commitbeaba6a43c287ceeaee0cb05c1a1b48604cd8cc5 (patch)
treeec56398bac847a92591c92a8c723351fecd53efb /tests/treestoretest.c
parent9b7d528ac208a72ce5f011c76f15a51641ed2136 (diff)
downloadgtk+-beaba6a43c287ceeaee0cb05c1a1b48604cd8cc5.tar.gz
more changes in an attempt to get it right. It's not yet ready for general
Wed Oct 24 20:29:47 2001 Kristian Rietveld <kristian@planet.nl> * gtk/gtktreemodelsort.c: more changes in an attempt to get it right. It's not yet ready for general consumption. * tests/treestoretest.c: add a button and entry for the new iter_change function (iter_change): new function, to test the row_changed signal implementation of the GtkTreeModelSort * tests/testtreesort.c: cleanups, changes to test more features of the GtkTreeModelSort at once
Diffstat (limited to 'tests/treestoretest.c')
-rw-r--r--tests/treestoretest.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/treestoretest.c b/tests/treestoretest.c
index 83adcd2d5f..9a0cf780d0 100644
--- a/tests/treestoretest.c
+++ b/tests/treestoretest.c
@@ -83,6 +83,25 @@ iter_insert (GtkWidget *button, GtkTreeView *tree_view)
}
static void
+iter_change (GtkWidget *button, GtkTreeView *tree_view)
+{
+ GtkWidget *entry;
+ GtkTreeIter selected;
+ GtkTreeModel *model = gtk_tree_view_get_model (tree_view);
+
+ entry = gtk_object_get_user_data (GTK_OBJECT (button));
+ if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
+ NULL, &selected))
+ {
+ gtk_tree_store_set (GTK_TREE_STORE (model),
+ &selected,
+ 1,
+ gtk_entry_get_text (GTK_ENTRY (entry)),
+ -1);
+ }
+}
+
+static void
iter_insert_before (GtkWidget *button, GtkTreeView *tree_view)
{
GtkTreeIter iter;
@@ -281,7 +300,17 @@ make_window (gint view_type)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (iter_insert),
tree_view);
-
+
+ button = gtk_button_new_with_label ("gtk_tree_store_set");
+ hbox = gtk_hbox_new (FALSE, 8);
+ entry = gtk_entry_new ();
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0);
+ gtk_object_set_user_data (GTK_OBJECT (button), entry);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (iter_change),
+ tree_view);
button = gtk_button_new_with_label ("gtk_tree_store_insert_before");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);