glade whit multiple windows

S

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top