how can I split signal dispatching codes into multi-packages while using Gtk2::GladeXML?



# example codes
Gtk2->init;
 my $gladefile = "./admin_center.glade";
 my $gui = Gtk2::GladeXML->new($gladefile) or die "wrong ";
 $gui->signal_autoconnect_from_package($self);
 
# example codes end
 
If I writes codes like avobe , I findI must write all signal handlers in main pakcage ,  it makes main package became very urgly .
 
so I had to use following codes to care it.
 
# in main package
# mouse release on treeview
sub on_treeview_button_release_event
{
# dispatching signal to the right package
 my $self = shift;
 $self->treeviewinstance->on_treeview_button_release_event(@_);
}
 
 
# in treeview package
# mouse release on treeview
sub on_treeview_button_release_event
{
   # do the work really
}
 
 
But If I did it so , I found there are more and more dispatching handler in the main package while the UI defined by galde XML file contanins more and more child widgets.
 
I'd like to know whether there is a way for me to handler signals from child widgets in child packages directly not dispatched by main pakcage or not ?
 
thanks in advance!
 

--
zhang li ming


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