Re: Custom TreeModel

* Emmanuel Rodriguez <emmanuel rodriguez gmail com> [2010-01-14 08:35]:
I see that there's not way to avoid the cache. It's a bit of
a pity that I can't detect when an iter is no longer needed as
eventually all nodes will be duplicated into the cache.

I'm guessing that with a normal (pure Perl) tree model this
will not be the case as nodes will be already in the model.
Using XML::LibXML nodes is a bit peculiar as the memory
management is a bit different. If I'm not mistaken XML::LibXML
assumes that nodes are attached to the underlying C model and
that the SVs wrapping them can be easily discarded at anytime
as long as the original C structure lives.

I could rewrite this tree model with a pure Perl tree model
(HTML::Tree) and add it to the Gtk2-Perl examples.

It sounds to me like what you want is to store some kind of
pointer in the iter (eg. an XPath) whereby the same node can be
re-requested from XML::LibXML in the event that it has to.

I think.

Aristotle Pagaltzis // <>

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