Re: SimpleList redraw/refresh



* muppet <scott asofyet org> [2004-07-13 14:28]:
I feel it would be better if the interface was something
along the lines of

   tie my @sl, 'Gtk2::Ex::Simple::List';

i think the issue is that we wanted to keep the widget and the
list together in one object.  what you're proposing means that
it's on the user to figure out and maintain which tied object
goes with which simplelist, and how do you do that?

You don't. (Unless you want to, of course.) You just call tied()
on the tied array to retrieve the object at a later time, just as
I wrote in my last message:

    tied(@sl)->get_selection->set_mode('multiple');

That would set the associated TreeView's selection mode.

However, I just thought of something else: this couples the
widget and its data store tightly, since from the Perl end of
things, they become one and the same -- and sharing the ListStore
becomes impossible. But the tied interface doesn't necessitate a
coupling with a particular widget; it could be part of the
ListStore class in general, transparent to the TreeView, only
visisble to the Perl programmer as a (big) convenience.

Which would mean that the tied interface would wander over into
Gtk2::ListStore proper. And Gtk2::Ex::Simple::List would be left
as nothing but a thin wrapper that instantiates a ListStore and
TreeView at once and keeps track of both together.

And now I'm not sure what to think anymore. :-) 

Regards,
-- 
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."



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