In this script timer not works. I know because event handler was never
executed (no output to console). But when I remove onTerminate
parameter when creating main window and use old event model
(mw_Terminate sub) then timer starts to work! Isn't it the bug?
No - I dont think so - try this:
use
Здравствуйте Jeremy,
Thursday, August 04, 2005, 3:38:52 PM, Вы написали:
>>In this script timer not works. I know because event handler was never
>>executed (no output to console). But when I remove onTerminate
>>parameter when creating main window and use old event model
>>(mw_Terminate sub) th
Yes, it works. But what if I need 2 timers? And does it mean that OEM
and NEM can not be mixed?
The event handler receives two parameters, the first is the window, the
second is the name of the timer. See code below to see how this works. As
for OEM/NEM - you can mix them sometimes, but I woul
Can you explain how the -ontimer option works?
-onTimer => \&T1_Timer,
Using -ontimer, how do you set how often it kicks off?
Steve
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jeremy White
Sent: Thursday, August 04, 2005 8:02 AM
To: [EMAIL PROTECTED]
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
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?
MillisecondsTimer Runs
250 once
500 twice
750 once
1000
In answer to my own question, I guess you could base what the sub did on
the timer name.
So you could set one timer per day, hour, and minute that did different
things based on the name of the timer..
use strict;
use Win32::GUI;
my $mw = Win32::GUI::Window->new(
-name => 'mw',
-size => [400
Сергей Черниенко wrote:
[ snipped timer-related stuff ]
And does it mean that OEM
and NEM can not be mixed?
By default a window/control uses the Original/Old Event Model (OEM),
where the sub that is called is the -name of the window/control followed
by '_' followed by the event name itself. (
Lloyd, Steve wrote:
Rob,
Is there a planned date for the next release?
Not really. Perhaps the end of the month would be a good target, but I
have some travel, so may not get to do a whole lot more between now and
then - lets see how things go.
Also, many of the common events do not work
While I'm an avid user fo Win32::GUI, I don't know
much about the internals... That being said, it does
seem more intuitive to be able to assign callbacks to
specific timers (as opposed to setting up a switch
type dispatcher based on the timer name.) Basically,
it would be like having an -onclick
10 matches
Mail list logo