Try this:
#-----------------------------------------
use strict;
use Win32::GUI;
my $count = 0;

my $W = new Win32::GUI::Window(
      -left   => 558,
      -top    => 122,
      -width  => 300,
      -height => 255,
      -name   => "W",
      -text   => "Test"
      );

$W->AddLabel(
       -text    => "$count",
       -name    => "count",
       -left    => 10,
       -top     => 10,
       -width   => 30,
       -height  => 13,
       -foreground    => 0,
      );

$W->AddButton(
       -text    => "start",
       -name    => "start",
       -left    => 126,
       -top     => 144,
       -width   => 42,
       -height  => 21,
       -foreground    => 0,
      );

$W->AddTimer("Timer1", 0);


$W->Timer1->Kill;
$W->Show();
Win32::GUI::Dialog();

sub start_Click {
    $W->Timer1->Interval(1000);
}

sub Timer1_Timer {
    $W->count->Text(++$count);
}
#-----------------------------------------

-----Original Message-----
From: carollyne courtney [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 17, 2002 8:35 AM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Minimized window inactive


How do I ensure that the counter continues running when the window is
minimized?

Thanks

-snip-

use strict;
use Win32::GUI;
my $count = 0;

my $W = new Win32::GUI::Window(
      -left   => 558,
      -top    => 122,
      -width  => 300,
      -height => 255,
      -name   => "W",
      -text   => "Test"
      );

$W->AddLabel(
       -text    => "$count",
       -name    => "count",
       -left    => 10,
       -top     => 10,
       -width   => 30,
       -height  => 13,
       -foreground    => 0,
      );

$W->AddButton(
       -text    => "start",
       -name    => "start",
       -left    => 126,
       -top     => 144,
       -width   => 42,
       -height  => 21,
       -foreground    => 0,
      );

$W->Show();
Win32::GUI::Dialog();

sub start_Click {
  while (1) {
    Win32::GUI::DoEvents();
    sleep 1;
    $count++;
    $W->count->Text($count);
  }
}





_________________________________________________________________
Broadband? Dial-up? Get reliable MSN Internet Access.
http://resourcecenter.msn.com/access/plans/default.asp



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

Reply via email to