[pygtk] Invalid TreeIter from custom treemodel
finlay at moeraki.com
Thu Aug 12 04:42:48 WST 2004
Vitaly Ostanin wrote:
> John Finlay wrote:
>>> Execution of my program output on stderr:
>>> ** (pix.py:11897): CRITICAL **: file pygtktreemodel.c: line 739
>>> (pygtk_generic_tree_model_ref_node): assertion `VALID_ITER(iter,
>>> tree_model)' failed
>>> Please, tell me, how I can get valid custom iters from XML node
>>> pointer ?
>>> Python 2.3.3
>> What code is generating the warning message? The above code doesn't
>> deal with TreeIters.
> May be :) Full example is attached.
Your custom model has a couple of broken methods:
on_iter_n_children() and on_iter_nth_child()
These do not properly handle the case where iter or parent is None.
These special cases indicate the toplevel rows should be used. See:
<cid:part1.03000202.03070209 at moeraki.com>
<cid:part2.01070303.04070005 at moeraki.com>
for more info. As a guess you should start each with something like:
if not node:
node = self.doc
More information about the pygtk