In this exciting installment:

Timers are now working in NEM mode. Create timers as normal. The onTimer NEM
event is triggered whenever any timer for the window ticks:

my $win = new Win32::GUI::Window (
    -name => "MainWin",
    -top => 100, -left => 100, -width => 100, -height => 100,
    -onTimer => \&timerEvent,
    ...
);

$win->AddTimer("a_timer",1000);
$win->AddTimer("another_timer",500);

$win->Show();

Win32::GUI::Dialog;

sub timerEvent {
    my($win, $timername) = @_;
    print $timername." just ticked!\n";
}


### Additions to changelog:

GUI.h : Added PERLWIN32GUI_NEM_TIMER event.
GUI.pm: fixed Win32::GUI::Class::new to avoid the "white background"
syndrome on Windows 2000. Fixed conditional so that all operating systems
with version above and including 5.1 have the no-white-background fix
applicable to windows xp and up.
GUI_MessageLoops.cpp: added WM_TIMER event to NEM_WindowMsgLoop, now NEM
handler -onTimer will be called whenever a timer added to the window
triggers. The NAME of the timer is provided as an argument to the handler.
GUI_Options.cpp: Fix to allow -onTimer.
GUI_Events.cpp: NEM Events always returned PerlResult of -2, even if a
handler was found and called for the event. Now it returns 0 if everything
was successful, as it should judging by the rest of the code.


Reply via email to