glade whit multiple windows

glade whit multiple windows

am 01.04.2008 00:13:40 von Spocchio

hi,
I'm making a glade-based tool: there is a window "father" that have to
open more child windows, 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, if I open more than 1 windows, when i click btnOk i get the some
result from all windows.
so when i run the init(), I overwrite the data of the previous window.
What could be the correct method to open more of the some window? i
don't think the package is the best solution.

thanx!