how can I split signal dispatching codes into multi-packages while using Gtk2::GladeXML?
- From: "zhang liming" <debianlm gmail com>
- To: gtk-perl-list gnome org
- Subject: how can I split signal dispatching codes into multi-packages while using Gtk2::GladeXML?
- Date: Thu, 28 Jun 2007 11:05:17 +0800
# 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]