Re: An automatic signal stub function generator



On Thu, 2003-09-18 at 17:21, Dan Lyke wrote:
Ross McFarland writes:
be sure to take a look at Gtk2::SimpleList and Gtk2::SimpleMenu as they are
attempts at this for very common needs.

Instant fix I'd like to see in Gtk2::SimpleList is the ability to
attach it to an extant widget. So that I can do something like:

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

i'm not sure that modifying the widgets of a gladexml hierarchy is a
good idea, if even possible b/c the signals are connected as the
heirarchy as it is being built. if you change the widget that's in their
you might could get switched, but those signals wouldn't be connected
and the parameters you set up in the glade builder will be lost. it's
just not a good idea. with a lot of work i might could be done but it
would probably require specific knowledge of GladeXML that doesn't
belong in SimpleList.

if you want to do something like this then you are better off building
the ui leaving the container in which you wish to put the SimpleList
blank then doing:

$gladexml = Gtk2::GladeXML->new('something.glade');
$gladexml->get_widget('list_vbox')->pack_start($simple_list,1,1,0);

you'd have to do all the signals by hand, but if you were to replace a
widget in the gladexml hierarchy then you'd have to anyway.

-rm




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