+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
+Fri Jun 15 18:53:48 2001 Jonathan Blandford <jrb@redhat.com>
+
+ * gtk/gtktreesortable.c (gtk_tree_sortable_set_sort_func): Rename
+ gtk_tree_sortable_sort_column_id_set_func. It's much shorter now.
+ * gtk/gtktreeview.c (gtk_tree_view_sort_iter_changed): WOOO!!!
+ Now I can really reorder/sort all Store widgets. treesorttest
+ seems to just work now.
+ * gtk/gtklistview.c (gtk_list_store_iter_changed): Whoops.
+ testtreesort worked through a big coincidence all this time.
+ * gtk/gtkrbtree.c (_gtk_rbtree_reorder): Nasty bug fix in nasty
+ code.
+ * tests/testtreecolumns.c: Big 'ol warning at the top letting
+ people know that this code should never ever ever be copied.
+
2001-06-15 Jonas Borgström <jonas@codefactory.se>
* gtk/gtkwindow.h: Fixed a small typo, it should be
/* sortable */
-static void gtk_list_store_sort (GtkListStore *list_store);
-static void gtk_list_store_sort_iter_changed (GtkListStore *list_store,
- GtkTreeIter *iter,
- gint column);
-static gboolean gtk_list_store_get_sort_column_id (GtkTreeSortable *sortable,
- gint *sort_column_id,
- GtkTreeSortOrder *order);
-static void gtk_list_store_set_sort_column_id (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeSortOrder order);
-static void gtk_list_store_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy);
+static void gtk_list_store_sort (GtkListStore *list_store);
+static void gtk_list_store_sort_iter_changed (GtkListStore *list_store,
+ GtkTreeIter *iter,
+ gint column);
+static gboolean gtk_list_store_get_sort_column_id (GtkTreeSortable *sortable,
+ gint *sort_column_id,
+ GtkTreeSortOrder *order);
+static void gtk_list_store_set_sort_column_id (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeSortOrder order);
+static void gtk_list_store_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy);
static void
{
iface->get_sort_column_id = gtk_list_store_get_sort_column_id;
iface->set_sort_column_id = gtk_list_store_set_sort_column_id;
- iface->sort_column_id_set_func = gtk_list_store_sort_column_id_set_func;
+ iface->set_sort_func = gtk_list_store_set_sort_func;
}
static void
GtkTreePath *path;
GValue real_value = {0, };
gboolean converted = FALSE;
+ gint orig_column = column;
- g_return_if_fail (list_store != NULL);
g_return_if_fail (GTK_IS_LIST_STORE (list_store));
g_return_if_fail (iter != NULL);
g_return_if_fail (column >= 0 && column < list_store->n_columns);
g_value_unset (&real_value);
if (GTK_LIST_STORE_IS_SORTED (list_store))
- gtk_list_store_sort_iter_changed (list_store, iter, column);
+ gtk_list_store_sort_iter_changed (list_store, iter, orig_column);
}
/**
}
static void
-gtk_list_store_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy)
+gtk_list_store_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy)
{
GtkListStore *list_store = (GtkListStore *) sortable;
GtkTreeDataSortHeader *header = NULL;
{
reorder = g_array_index (array, GtkRBReorder, i);
node->children = reorder.children;
+ if (node->children)
+ node->children->parent_node = node;
node->flags = GTK_RBNODE_GET_COLOR (node) | reorder.flags;
/* We temporarily set the height to this. */
node->offset = reorder.height;
GtkTreePath *end_path,
GtkTreeIter *end_iter)
{
+ gint i;
g_return_if_fail (tree_model != NULL);
g_return_if_fail (GTK_IS_TREE_MODEL (tree_model));
g_return_if_fail (start_path != NULL);
g_return_if_fail (end_path != NULL);
g_return_if_fail (end_iter != NULL);
+#ifndef G_DISABLE_CHECKS
+ g_return_if_fail (start_path->depth == end_path->depth);
+ for (i = 0; i < start_path->depth - 1; i++)
+ if (start_path->indices[i] != end_path->indices[i])
+ {
+ g_warning ("Concurrent paths were not passed in to gtk_tree_model_range_changed.\n");
+ return;
+ }
+#endif
g_signal_emit_by_name (tree_model, "range_changed",
start_path, start_iter,
end_path, end_iter);
GtkTreeIter *iter);
/* sortable */
-static gboolean gtk_tree_model_sort_get_sort_column_id (GtkTreeSortable *sortable,
- gint *sort_column_id,
- GtkTreeSortOrder *order);
-static void gtk_tree_model_sort_set_sort_column_id (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeSortOrder order);
-static void gtk_tree_model_sort_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy);
+static gboolean gtk_tree_model_sort_get_sort_column_id (GtkTreeSortable *sortable,
+ gint *sort_column_id,
+ GtkTreeSortOrder *order);
+static void gtk_tree_model_sort_set_sort_column_id (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeSortOrder order);
+static void gtk_tree_model_sort_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy);
/* Internal functions */
static gint gtk_tree_model_sort_array_find_insert (GtkTreeModelSort *tree_model_sort,
{
iface->get_sort_column_id = gtk_tree_model_sort_get_sort_column_id;
iface->set_sort_column_id = gtk_tree_model_sort_set_sort_column_id;
- iface->sort_column_id_set_func = gtk_tree_model_sort_sort_column_id_set_func;
+ iface->set_sort_func = gtk_tree_model_sort_set_sort_func;
}
static void
static void
gtk_tree_model_sort_set_sort_column_id (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeSortOrder order)
+ gint sort_column_id,
+ GtkTreeSortOrder order)
{
GtkTreeModelSort *tree_model_sort = (GtkTreeModelSort *) sortable;
GList *list;
}
static void
-gtk_tree_model_sort_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy)
+gtk_tree_model_sort_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy)
{
GtkTreeModelSort *tree_model_sort = (GtkTreeModelSort *) sortable;
GtkTreeDataSortHeader *header = NULL;
}
void
-gtk_tree_sortable_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy)
+gtk_tree_sortable_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy)
{
GtkTreeSortableIface *iface;
iface = GTK_TREE_SORTABLE_GET_IFACE (sortable);
g_return_if_fail (iface != NULL);
- g_return_if_fail (iface->sort_column_id_set_func != NULL);
+ g_return_if_fail (iface->set_sort_func != NULL);
- (* iface->sort_column_id_set_func) (sortable, sort_column_id, func, data, destroy);
+ (* iface->set_sort_func) (sortable, sort_column_id, func, data, destroy);
}
void (* sort_column_changed) (GtkTreeSortable *sortable);
/* virtual table */
- gboolean (* get_sort_column_id) (GtkTreeSortable *sortable,
- gint *sort_column_id,
- GtkTreeSortOrder *order);
- void (* set_sort_column_id) (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeSortOrder order);
- void (* sort_column_id_set_func) (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy);
+ gboolean (* get_sort_column_id) (GtkTreeSortable *sortable,
+ gint *sort_column_id,
+ GtkTreeSortOrder *order);
+ void (* set_sort_column_id) (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeSortOrder order);
+ void (* set_sort_func) (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy);
};
GType gtk_tree_sortable_get_type (void) G_GNUC_CONST;
-void gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable);
-gboolean gtk_tree_sortable_get_sort_column_id (GtkTreeSortable *sortable,
- gint *sort_column_id,
- GtkTreeSortOrder *order);
-void gtk_tree_sortable_set_sort_column_id (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeSortOrder order);
-void gtk_tree_sortable_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy);
-
+void gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable);
+gboolean gtk_tree_sortable_get_sort_column_id (GtkTreeSortable *sortable,
+ gint *sort_column_id,
+ GtkTreeSortOrder *order);
+void gtk_tree_sortable_set_sort_column_id (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeSortOrder order);
+void gtk_tree_sortable_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy);
/* gtktreestore.c
- * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
+ * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
static void gtk_tree_store_set_sort_column_id (GtkTreeSortable *sortable,
gint sort_column_id,
GtkTreeSortOrder order);
-static void gtk_tree_store_sort_column_id_set_func (GtkTreeSortable *sortable,
+static void gtk_tree_store_set_sort_func (GtkTreeSortable *sortable,
gint sort_column_id,
GtkTreeIterCompareFunc func,
gpointer data,
{
iface->get_sort_column_id = gtk_tree_store_get_sort_column_id;
iface->set_sort_column_id = gtk_tree_store_set_sort_column_id;
- iface->sort_column_id_set_func = gtk_tree_store_sort_column_id_set_func;
+ iface->set_sort_func = gtk_tree_store_set_sort_func;
}
static void
/**
* gtk_tree_store_set_n_columns:
- * @tree_store:
- * @n_columns:
- *
+ * @tree_store:
+ * @n_columns:
+ *
* As a side effect of calling this function, all sort columns that overlap with
* the current number of columns will be removed.
**/
g_return_val_if_fail (GTK_IS_TREE_STORE (tree_model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
g_return_val_if_fail (iter->user_data != NULL, NULL);
+ g_return_val_if_fail (iter->stamp == GTK_TREE_STORE (tree_model)->stamp, NULL);
validate_tree ((GtkTreeStore*)tree_model);
+ if (G_NODE (iter->user_data)->parent == NULL &&
+ G_NODE (iter->user_data) == GTK_TREE_STORE (tree_model)->root)
+ return gtk_tree_path_new ();
g_assert (G_NODE (iter->user_data)->parent != NULL);
if (G_NODE (iter->user_data)->parent == G_NODE (GTK_TREE_STORE (tree_model)->root))
GtkTreePath *path = NULL;
GValue real_value = {0, };
gboolean converted = FALSE;
+ gint orig_column = column;
- g_return_if_fail (tree_store != NULL);
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
+ g_return_if_fail (iter != NULL);
+ g_return_if_fail (GTK_TREE_STORE (tree_store)->stamp == iter->stamp);
g_return_if_fail (column >= 0 && column < tree_store->n_columns);
g_return_if_fail (G_IS_VALUE (value));
g_value_unset (&real_value);
if (GTK_TREE_STORE_IS_SORTED (tree_store))
- gtk_tree_store_sort_iter_changed (tree_store, iter, column);
+ gtk_tree_store_sort_iter_changed (tree_store, iter, orig_column);
}
/**
static void
gtk_tree_store_sort_helper (GtkTreeStore *tree_store,
- GNode *node)
+ GNode *parent,
+ gboolean recurse)
{
GtkTreeDataSortHeader *header = NULL;
GtkTreeIter iter;
GArray *sort_array;
+ GNode *node;
GNode *tmp_node;
gint list_length;
gint i;
gint *new_order;
GtkTreePath *path;
+ node = parent->children;
if (node->next == NULL)
return;
}
g_array_index (sort_array, SortTuple, list_length - 1).node->next = NULL;
g_array_index (sort_array, SortTuple, 0).node->prev = NULL;
- G_NODE (tree_store->root)->children = g_array_index (sort_array, SortTuple, 0).node;
+ parent->children = g_array_index (sort_array, SortTuple, 0).node;
/* Let the world know about our new order */
new_order = g_new (gint, list_length);
for (i = 0; i < list_length; i++)
new_order[i] = g_array_index (sort_array, SortTuple, i).offset;
- path = gtk_tree_path_new ();
- iter.stamp = tree_store->stamp;
- iter.user_data = NULL;
+ iter.stamp = tree_store->stamp;
+ iter.user_data = parent;
+ path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), &iter);
gtk_tree_model_reordered (GTK_TREE_MODEL (tree_store),
path, &iter, new_order);
gtk_tree_path_free (path);
g_free (new_order);
g_array_free (sort_array, TRUE);
+
+ if (recurse)
+ {
+ for (tmp_node = parent->children; tmp_node; tmp_node = tmp_node->next)
+ {
+ if (tmp_node->children)
+ gtk_tree_store_sort_helper (tree_store, tmp_node, TRUE);
+ }
+ }
}
static void
gtk_tree_store_sort (GtkTreeStore *tree_store)
{
- gtk_tree_store_sort_helper (tree_store, G_NODE (tree_store->root)->children);
+ gtk_tree_store_sort_helper (tree_store, G_NODE (tree_store->root), TRUE);
}
static void
gint *new_order;
gint length;
- /* FIX*/
- if (G_NODE (iter->user_data)->parent)
- node = G_NODE (iter->user_data)->parent->children;
- else
- node = G_NODE (tree_store->root);
+ g_return_if_fail (G_NODE (iter->user_data)->parent != NULL);
+
tmp_iter.stamp = tree_store->stamp;
header = _gtk_tree_data_list_get_header (tree_store->sort_list,
return;
old_location = 0;
+ node = G_NODE (iter->user_data)->parent->children;
/* First we find the iter, its prev, and its next */
while (node)
{
if (node == G_NODE (iter->user_data))
break;
- prev = node;
- node = node->next;
old_location++;
+ node = node->next;
}
g_assert (node != NULL);
+ prev = node->prev;
next = node->next;
/* Check the common case, where we don't need to sort it moved. */
/* We actually need to sort it */
/* First, remove the old link. */
- if (prev == NULL)
- tree_store->root = next;
- else
+ if (prev)
prev->next = next;
+ else
+ node->parent->children = next;
+ if (next)
+ next->prev = prev;
+
+ node->prev = NULL;
node->next = NULL;
-
+
/* FIXME: as an optimization, we can potentially start at next */
prev = NULL;
- node = G_NODE (tree_store->root);
+ node = node->parent->children;
new_location = 0;
tmp_iter.user_data = node;
if (tree_store->order == GTK_TREE_SORT_DESCENDING)
if ((!node->next) && (cmp_a > 0))
{
node->next = G_NODE (iter->user_data);
+ node->next->prev = node;
}
else if (prev)
{
prev->next = G_NODE (iter->user_data);
+ prev->next->prev = prev;
G_NODE (iter->user_data)->next = node;
+ G_NODE (iter->user_data)->next->prev = G_NODE (iter->user_data);
}
else
{
- G_NODE (iter->user_data)->next = G_NODE (tree_store->root);
- tree_store->root = G_NODE (iter->user_data);
+ G_NODE (iter->user_data)->next = G_NODE (iter->user_data)->parent->children;
+ G_NODE (iter->user_data)->parent->children = G_NODE (iter->user_data);
}
/* Emit the reordered signal. */
new_order[i] = old_location;
}
-
- tmp_path = gtk_tree_path_new ();
- tmp_iter.user_data = NULL;
+ tmp_iter.user_data = node->parent;
+ tmp_path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), &tmp_iter);
gtk_tree_model_reordered (GTK_TREE_MODEL (tree_store),
tmp_path, &tmp_iter,
}
static void
-gtk_tree_store_sort_column_id_set_func (GtkTreeSortable *sortable,
- gint sort_column_id,
- GtkTreeIterCompareFunc func,
- gpointer data,
- GtkDestroyNotify destroy)
+gtk_tree_store_set_sort_func (GtkTreeSortable *sortable,
+ gint sort_column_id,
+ GtkTreeIterCompareFunc func,
+ gpointer data,
+ GtkDestroyNotify destroy)
{
GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
GtkTreeDataSortHeader *header = NULL;
flags |= GTK_CELL_RENDERER_SELECTED;
parity = _gtk_rbtree_node_find_parity (tree, node);
-
+
for (i = 0, list = tree_view->priv->columns; i < tree_view->priv->n_columns; i++, list = list->next)
{
GtkTreeViewColumn *column = list->data;
#include <gtk/gtk.h>
+/*
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ * README README README README README README README README README README
+ *
+ * DO NOT!!! I REPEAT DO NOT! EVER LOOK AT THIS CODE AS AN EXAMPLE OF WHAT YOUR
+ * CODE SHOULD LOOK LIKE.
+ *
+ * IT IS VERY CONFUSING, AND IS MEANT TO TEST A LOT OF CODE IN THE TREE. WHILE
+ * IT IS ACTUALLY CORRECT CODE, IT IS NOT USEFUL.
+ */
GtkWidget *left_tree_view;
GtkWidget *top_right_tree_view;
-/* Kids, don't try this at home.
- */
+/* Kids, don't try this at home. */
/* Small GtkTreeModel to model columns */
typedef struct _ViewColumnModel ViewColumnModel;
gtk_tree_store_set (base_model, iter, 0, str, -1);
g_free (str);
- n = g_random_int ();
+ n = g_random_int_range (10000,99999);
if (n < 0)
n *= -1;
str = g_strdup_printf ("%d", n);