On Sun, 2002-12-29 at 19:18, David M. Cook wrote:
> On Sun, Dec 29, 2002 at 12:25:09PM +0100, Arjan J. Molenaar wrote:
> 
> > I have no problem with the GenericTreeModel. I use it in Gaphor
> > (http://gaphor.sf.net) and even use editable cells (with an icon).
> 
> Thanks, that looks interesting.  I'm particularly curious about what the
> "leak_references" property does.  However, you only seem to have 1 column in
> your tree and some of my problems are related to having multiple columns.

leak_references does what it says ;-): leak references. As you know, the
TreeModel makes heavy use of iterators. One of the "not so nice" things
about those iterators is that they get destroyed without any
notification. leak_references == 1 will keep a reference on the Python
object that works as the iterator. This might cause reference count
leaks (and therefore memory leaks). when leak_references == 0, the
Python object that works as the iterator is dereferenced (so it becomes
a weak reference). Problem is that your tree model has to keep track of
the iterators, otherwise you get a segmentation fault. I hope this
explains it a little bit (I'm not in a very explainory mood today ;-).

> I'm getting so frustrated with it, I'm actually thinking of rewriting the
> app in Jython/Swing.

Make sure your model and view expect the same things, as I did with the
NamespaceView.

Regards,

Arjan


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to