Re: Problems getting the TreeIter data for a custom TreeModel



Quoting muppet <scott asofyet org>:

i sent zach (offlist) a quick and dirty patch to test out, exporting
inter_from_sv() as Gtk2::TreeIter::to_sv() (not a great name, just a
proof of concept).  did it work?

It looks like I accidentally sent my response (actually two of them) to
this message only to muppet instead of the whole list.  Unfortunately I
don't have an exact copy.

The to_sv binding does work just like I want it to.  I think that it's
pretty unlikely that anyone is going to call it except from a TreeModel
implementation, so there should really only be problems when it gets
called on a TreeIter that doesn't belong to the calling TreeModel.

Since the stamp member of the iter is always an unsigned int, it should be
safe for the binding to access that member regardless of what model
created the iter.  So, if the to_sv method requires a stamp as an
argument also, the two can be compared to make sure that the iter belongs
to the caller.  That should make to_sv more safe, I think.

I'm also planning to experiment with a binding for iter_from_sv to go the
other way.

Zach

-- 
And I say, Give me back my memory, or I'll rip you into three boy scouts
and a watchband!
                                           ---Aaron in "Remind Me Again"
------------------------------------------------------------------------
Zach Bean, zb forty2 com, web forty2 com          http://www.forty2.com

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



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