[pygtk] TreeModelSort breaks my TreeModel and acts strangely
Lionel Dricot
zeploum at gmail.com
Wed Feb 24 02:41:00 WST 2010
Hello,
I've implemented my own TreeModel based on GenericTreeModel and, according
to my tests, it works fine. It's called TaskTreeModel.
If I put it in a TreeView, it works perfectly, although I've no sorting.
Thus:
gtk.TreeView -> TaskTreeModel works fine.
If I put a TreeModelSort above my model, everything goes crazy. By crazy, I
means that, in the TreeModelSort itself, the structure is crazy (nodes are
duplicated at what appear to be random path) and the TreeView displays
nothing (except sometimes one or two rows, no more). Thus:
gtkTreeView -> TreeModelSort -> TaskTreeModel is broken both at TreeView
and ModelSort level.
With debugging print, I can be sure that the structure in TaskTreeModel is
what I expect.
If, instead of a TreeModelSort, I put a TreeModelFilter, it "nearly works".
Nearly because some rows are duplicated but, at least, it looks more or less
like what I want.
If I put both the Sort and the Filter, everything is broken again.
I was told that there's probably a bug in my TaskTreeModel in some corner
case not covered by the TaskView but well by the ModelSort or the
ModelFilter.
How can I debug that ? Have you any advice ?
Also, strangely enough, when I start the application, the treeview appears
empty as long as I don't trigger a refresh. This is the case with both
tasktreemodel and treemodelsort but doesn't happen with a treemodelfilter in
the stack !
Thanks for advice,
Lionel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100223/17a65fdd/attachment.htm
More information about the pygtk
mailing list