Commit 6e7b8a67 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

Fix arguments to reordered signal.

Tue Mar 27 22:07:44 2001  Jonathan Blandford  <jrb@webwynk.net>

	* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
	reordered signal.

	* tests/testtreesort.c (main): fix spelling.
Bad Jonathan.  Don't break the tree.
parent 88bbc2a5
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
Tue Mar 27 22:07:44 2001 Jonathan Blandford <jrb@webwynk.net>
* gtk/gtkliststore.c (gtk_list_store_sort): Fix arguments to
reordered signal.
* tests/testtreesort.c (main): fix spelling.
Tue Mar 27 20:55:29 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c: More work on implementing sortable
......
......@@ -284,7 +284,7 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
state = GTK_STATE_INSENSITIVE;
else
state = GTK_STATE_NORMAL;
if (celltoggle->radio)
{
gtk_paint_option (widget->style,
......
......@@ -412,8 +412,7 @@ gtk_list_store_get_iter (GtkTreeModel *tree_model,
if (i >= GTK_LIST_STORE (tree_model)->length)
return FALSE;
list = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root),
i);
list = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root), i);
/* If this fails, list_store->length has gotten mangled. */
g_assert (list);
......@@ -524,7 +523,9 @@ static gint
gtk_list_store_iter_n_children (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
if (iter == NULL)
g_return_val_if_fail (GTK_LIST_STORE (tree_model)->stamp == iter->stamp, -1);
if (iter->user_data == NULL)
return GTK_LIST_STORE (tree_model)->length;
else
return 0;
......@@ -547,8 +548,8 @@ gtk_list_store_iter_nth_child (GtkTreeModel *tree_model,
if (child)
{
iter->user_data = child;
iter->stamp = GTK_LIST_STORE (tree_model)->stamp;
iter->user_data = child;
return TRUE;
}
else
......@@ -849,8 +850,8 @@ gtk_list_store_remove (GtkListStore *list_store,
validate_list_store (list_store);
list_store->stamp ++;
gtk_tree_model_deleted (GTK_TREE_MODEL (list_store), path);
gtk_tree_path_free (path);
}
......@@ -1290,6 +1291,7 @@ gtk_list_store_drag_data_received (GtkTreeDragDest *drag_dest,
++col;
}
dest_iter.stamp = GTK_LIST_STORE (tree_model)->stamp;
G_SLIST (dest_iter.user_data)->data = copy_head;
path = gtk_list_store_get_path (GTK_TREE_MODEL (tree_model), &dest_iter);
......@@ -1391,6 +1393,7 @@ static void
gtk_list_store_sort (GtkListStore *list_store)
{
GtkTreeDataSortHeader *header = NULL;
GtkTreeIter iter;
GArray *sort_array;
gint i;
GList *header_list;
......@@ -1447,8 +1450,10 @@ gtk_list_store_sort (GtkListStore *list_store)
for (i = 0; i < list_store->length; i++)
new_order[i] = g_array_index (sort_array, SortTuple, i).offset;
path = gtk_tree_path_new ();
iter.stamp = list_store->stamp;
iter.user_data = NULL;
gtk_tree_model_reordered (GTK_TREE_MODEL (list_store),
path, new_order);
path, &iter, new_order);
gtk_tree_path_free (path);
g_free (new_order);
g_array_free (sort_array, TRUE);
......
......@@ -1070,13 +1070,14 @@ gtk_tree_model_deleted (GtkTreeModel *tree_model,
void
gtk_tree_model_reordered (GtkTreeModel *tree_model,
GtkTreePath *path,
GtkTreeIter *iter,
gint *new_order)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (GTK_IS_TREE_MODEL (tree_model));
g_return_if_fail (new_order != NULL);
g_signal_emit_by_name (tree_model, "reordered", path, new_order);
g_signal_emit_by_name (tree_model, "reordered", path, iter, new_order);
}
......
......@@ -188,7 +188,9 @@ static void gtk_tree_view_deleted (GtkTreeModel *model,
gpointer data);
static void gtk_tree_view_reordered (GtkTreeModel *model,
GtkTreePath *parent,
gint *new_order);
GtkTreeIter *iter,
gint *new_order,
gpointer data);
/* Internal functions */
static void gtk_tree_view_unref_tree (GtkTreeView *tree_view,
GtkRBTree *tree);
......@@ -3009,20 +3011,20 @@ gtk_tree_view_deleted (GtkTreeModel *model,
static void
gtk_tree_view_reordered (GtkTreeModel *model,
GtkTreePath *parent,
gint *new_order)
GtkTreeIter *iter,
gint *new_order,
gpointer data)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (model);
GtkTreeIter iter;
GtkTreeView *tree_view = GTK_TREE_VIEW (data);
GArray *array;
gint len;
gtk_tree_model_get_iter (model, parent, &iter);
len = gtk_tree_model_iter_n_children (model, &iter);
len = gtk_tree_model_iter_n_children (model, iter);
if (len < 2)
return;
gtk_widget_queue_draw (GTK_WIDGET (data));
}
/* Internal tree functions */
......@@ -3170,7 +3172,9 @@ gtk_tree_view_calc_size (GtkTreeView *tree_view,
else
gtk_tree_view_column_set_width (column, MAX (column->width, width));
}
_gtk_rbtree_node_set_height (tree, temp, max_height);
if (temp->children != NULL &&
gtk_tree_model_iter_children (tree_view->priv->model, &child, iter))
gtk_tree_view_calc_size (tree_view, temp->children, &child, depth + 1);
......
......@@ -15,8 +15,8 @@ static ListSort data[] =
{ "Apples", "Transmorgrify", "Exculpatory", "Gesundheit"},
{ "Oranges", "Wicker", "Adamantine", "Convivial" },
{ "Bovine Spongiform Encephilopathy", "Sleazebucket", "Mountaineer", "Pander" },
{ "Foot and Mouth", "Lampshade", "Skim Milk\nFull Milk", "Viewless" },
{ "Blood,\nsweat,\ntears", "The Man", "Horses", "Muckety-Muck" },
{ "Foot and Mouth", "Lampshade", "Skim Milk Full Milk", "Viewless" },
{ "Blood, sweat, tears", "The Man", "Horses", "Muckety-Muck" },
{ "Rare Steak", "Siam", "Watchdog", "Xantippe" },
{ "SIGINT", "Rabbit Breath", "Alligator", "Bloodstained" },
{ "Google", "Chrysanthemums", "Hobnob", "Leapfrog"},
......@@ -56,7 +56,7 @@ main (int argc, char *argv[])
gtk_signal_connect (GTK_OBJECT (window), "destroy", gtk_main_quit, NULL);
vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("My List of cool words"), FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("My list of cool words"), FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment