Subclassing Gtk2::TreeModel



I'm moving code from Perl::Tk, and after fighting with Gtk2::TreeStore
I've decided that maybe I'm better off writing my own tree structure
that implements a GtkTreeModel interface.

The thing I want right now is a node that reports itself as having
children, but that I don't have to fill in children for until it's
actually clicked on, and I could do this by entering dummy data and
then deleting and reinserting when I actually have to expand it, but
fooling Gtk2::TreeStore that way seems like an awful lot of work.

So, in my heat coma yesterday evening, I slapped together a little
class that had Gtk2::TreeModel in its @ISA, had all the appropriate
interface functions, and...

Well, y'all have done *awesome* stuff, so I thought *maybe* it'd work,
but I wasn't surprised that none of my callbacks got called. It makes
sense that that stuff isn't getting thunked through Perl, that'd kill
performance.

So, is this a good idea? And if so, what sort of keywords should I be
looking for to search for the right info to create a Perl object (or
set of objects, I'd also need an appropriate TreeIter) that would
implement a GtkTreeModel interface?

And if not, then I'll go back to fooling Gtk2::TreeStore into showing
what I want by playing silly games with its data.

Dan




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