Re: signal functions in a package module file
- From: anguila <anguila gmail com>
- To: "Matthew Braid" <ptkperl mdb id au>
- Cc: "gtk-perl-list gnome org List" <gtk-perl-list gnome org>
- Subject: Re: signal functions in a package module file
- Date: Mon, 21 Jul 2008 23:35:09 +0200
Without POO (I'm trying now), the thing that muppet say, I attempted
it but only works when you call a function of the package with a
signal of the actual window. When you already opened another window,
those signals like the button widget, you can't put it through a
argument... so you don't have de gladexml reference.
main.pl:
#!/usr/bin/perl -w
use Gtk2 '-init';
use Gtk2::GladeXML;
use finestra2;
my $programa = Gtk2::GladeXML->new('prova.glade');
$programa->signal_autoconnect_from_package('main');
print "Mostrant finestra1!\n";
my $window1= $programa->get_widget('window1');
$window1->show();
Gtk2->main;
sub on_button1_clicked {
my $entry= $programa->get_widget('entry1');
finestra2::init($programa);
--------------------------
finestra2.pm:
package finestra2;
sub window2_clicked_button{
# reference of gladexml is needed
my $entry= $programa->get_widget('entry1');
my $label= $programa->get_widget('label3');
$label->set_text("JOAS");
print "Done, content= $content\n";
}
sub init {
my $programa= shift;
my $window= $programa->get_widget('window2');
$window->show_all();
}
return 1;
__END__
The signal window2_clicked_button it works, but i don't know how get
the $programa reference :\
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]