reordering top-level items in a tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I'm trying to reorder items in a GtkTreeStore using
gtk_tree_store_swap().  This works fine if the items being reordered are
on a sub-level of the tree, but is fails when reordering top-level
items.

(test:7491): Gtk-CRITICAL **: file gtktreemodel.c: line 626
(gtk_tree_path_compare): assertion `a->depth > 0' failed
 
Looking at the source of gtk_tree_store_swap(), I see that parents of
both items are found in order to determine if both items belong to the
same level.  Top-level items do not have a parent so it fails.

The manual says nothing about this function not working on top level
items.  And if this function can't do it, then how can top-level items
be reordered?

Here is a small test program demonstrating the behavior:
http://worksintheory.org/files/misc/tree-swap.c

Nathan


_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux