Gtk2::SimpleList->new_from_widget (was Re: An automatic signal stub function generator)




On Thursday, September 18, 2003, at 05:21 PM, Dan Lyke wrote:

$gladexml = Gtk2::GladeXML->new('something.glade');
$treeview = Gtk2::SimpleList->new(-widget => $gladexml->get_widget('treeview1'));

this was actually really easy.

i implemented it as Gtk2::SimpleList->new_from_widget ($widget, key => val, ...); since 'widget' could be a column name. if you use undef for $widget, it's the same as Gtk2::SimpleList->new (). it returns $widget, reblessed as a Gtk2::SimpleList.


the problem with this approach is that it will only work with re-blessing. we won't be able to add new signals for SimpleList, because that requires registering a GType, and GObjects can't change their type after they're created. then again, i can't think of a proper reason to add a new signal to a SimpleList...

so i thought it was a decision best left to the list. what do you guys think?

patch attached.

Attachment: simplelist-new-from-widget.patch
Description: Binary data



--
muppet <scott at asofyet dot org>


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