Adding rows to a sorted GtkTreeModel causes warnings




    I'm using a GtkTreeView with a GtkTreeStore model that is sorted
using the GtkTreeSortable interface. I first add all the rows, then set
the sort column. However, there is a point in which I need to add
another row after the sorting has started, and this causes a warning to
be printed:

Gtk-CRITICAL **: gtk_tree_path_get_depth: assertion `path != NULL' failed

It turns out that the sort function is called with one iter that causes
NULL to be returned with gtk_tree_model_get_path(), and later I use
gtk_tree_path_get_depth() in that path.

   Maybe the description above was not very good, but I'm attaching a
very simple test program. When run, you'll see the warning once, and it
is triggered by the _set function that creates the "AAA" entry. The
button adds further entries, that trigger the warning again.

   I do not know under which circunstances gtk_tree_model_get_path()
returns NULL, especially because that iter seems valid. However, there
seems to be something weird going on here.

-- 
Never trust an automatic pistol or a D.A.'s deal.
                -- John Dillinger

Eduardo M KALINOWSKI
ekalin bol com br
http://move.to/hpkb



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