Yes it does.  So, I guess I do not see its usefulness. 
In your example the same sub would be kicked off multiple times at the
same time, right?
How is this useful?

Milliseconds    Timer Runs
250                     once
500                     twice
750                     once
1000                    three times
2000                    four times

-----Original Message-----
From: Jeremy White [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 04, 2005 10:30 AM
To: Lloyd, Steve; [EMAIL PROTECTED];
perl-win32-gui-users@lists.sourceforge.net
Subject: RE: Re[2]: [perl-win32-gui-users] working/not working timer



>Can you explain how the -ontimer option works?
>-onTimer => \&T1_Timer,

The onTime is the event handler for all timers for a specific window. In
the 
example below, we're adding 4 timers to the window. When the timer is
fired, 
it's name is printed out. Does that help?

Cheers,

jez.

use strict;
use Win32::GUI;

my $mw = Win32::GUI::Window->new(
  -name => 'mw',
  -size => [400, 400],
  -pos => [200, 200],
  -onTerminate => sub{return -1;},
  -onTimer     => sub{print $_[1]."\n"},
);
$mw->AddTimer('Slow', 2000);
$mw->AddTimer('Medium', 1000);
$mw->AddTimer('Quick', 500);
$mw->AddTimer('Very Quick', 250);
$mw->Show;
Win32::GUI::Dialog;



This email, and any files previous email messages included with it, may contain 
confidential and/or privileged material. If you are not the intended recipient 
please contact the sender and delete all copies.



Reply via email to