擅长:python、mysql、java
<p>尽管unwind的答案是正确的,足以让我走上正轨,但我还是想为了完整起见添加我的最终解决方案:</p>
<p>Python:</p>
<pre><code>def model_get_iter_last( model, parent=None ):
"""Returns a gtk.TreeIter to the last row or None if there aren't any rows.
If parent is None, returns a gtk.TreeIter to the last root row."""
n = model.iter_n_children( parent )
return n and model.iter_nth_child( parent, n - 1 )
</code></pre>
<p>C:</p>
^{pr2}$