David

does this do what you want? It is a little clunky but it does the job.

Jake


use Win32::GUI;

$Win = new Win32::GUI::Window(
      -left   => 341,
      -top    => 218,
      -width  => 300,
      -height => 213,
      -name   => "Win",
      -text   => "Window Title"
      );

$Win->Show();

$Win->AddButton(
       -text    => "Loop",
       -name    => "Loop",
       -left    => 104.5,
       -top     => 102,
       -width   => 95,
       -height  => 28,
      );

$Win2 = new Win32::GUI::Window(
      -left   => 391,
      -top    => 238,
      -width  => 200,
      -height => 183,
      -name   => "Win2",
      -title   => "New Window",
      );

$Win2->AddLabel(
       -text    => "",
       -name    => "Label",
       -left    => 60,
       -top     => 30,
       -width   => 20,
       -height  => 20,
      );

$Win2->AddButton(
       -text    => "OK",
       -name    => "OK",
       -left    => 50,
       -top     => 102,
       -width   => 95,
       -height  => 28,
      );


Win32::GUI::Dialog();

sub Win_Terminate {
   return -1;
}

sub OK_Click {
   $Win2->Hide();

   # I added this
   #
   return -1;
}

sub Loop_Click {

   foreach $i (0 ... 3) {
     &Show_Win2($i);
     sleep 1;
   }
}

sub Show_Win2 {
   my($num) = @_;

   $Win2->Label->Text($num);
   $Win2->Show();

   # And this
   #
   Win32::GUI::Dialog();
}

Reply via email to