[Glade-users] multiple istance of glade whit perl
Antonio Ragagnin
spocchio at gmail.com
Tue Apr 15 14:39:53 EDT 2008
Hi
i'm writing a tool that,when a button is clicked a new glade window is
open, here my code:
sub btnNewMessage_onclick {
my $newWin = Gtk2::GladeXML->new('gui/wSMS.glade');
my $newForm = $newWin->get_widget('wSMS');
$newWin->signal_autoconnect_from_package('callbackSMS');
$newForm->show;
}
package callbackSMS;
my $ID;
sub init { #it's on form.show()
$ID=rand(0,1000);
}
sub btnOk_clicked {
print $ID;
}
Ok, everytime i click btnNewMessage, a new window appear. but if i
click btnOk, the value of $ID will be the same for all windows!
it seems that every $newWin share the same package "callbackSMS"
there is some way to separate the packages? or using a class?
thx
More information about the Glade-users
mailing list