
=head1 NAME

Win32::GUI::Timer - Create and manipulate periodic Timer events

=head1 DESCRIPTION

The Timer object is a special kind of control: it has no appearance, its only
purpose is to trigger an event every specified amount of time.  You can create a
Timer object in either of these ways:

  new Win32::GUI::Timer( PARENT, NAME, ELAPSE )
  PARENT->AddTimer( NAME, ELAPSE )

where C<NAME> is the name for the Timer object (used to lookup the associated event).
and C<ELAPSE> is the number of milliseconds after which the Timer() event will
be periodically triggered.

Once you've created the Timer object, you can change the ELAPSE parameter
with the L<Interval()|/Interval> method, or disable the Timer with the
L<Kill()|/Kill> method.

The triggered OEM event is called as "$name_Timer"()
The triggered NEM event is defined as -onTimer => sub{} method of the parent window.

=for comment $Id: per_package_method_section.tpl,v 1.3 2006/03/16 21:11:13 robertemay Exp $

=head1 METHODS

L<Common methods|Win32::GUI::Reference::Methods> apply to most windows, controls and resources.

=for comment $Id: per_package_method.tpl,v 1.3 2006/03/16 21:11:13 robertemay Exp $

=head2 new

B<new(PARENT, [NAME, [ELAPSE]])>

Creates a new timer in the PARENT window named NAME that will
trigger its Timer() event after ELAPSE milliseconds.
Can also be called as PARENT->AddTimer(NAME, ELAPSE).

If NAME is not supplied, then an internal name will be allocated.

ELAPSE must by an integer greater than or equal to zero.  If ELAPSE
is 0, then the timer object is created, but the timer will be disabled.
You can then start the timer by calling the L<Interval()|/Interval> method
and setting ELAPSE to a non-zero number. If ELASPE is not supplied, then
0 will be used.

Note: Different OS versions might change too low or large intervals for ELAPSE
to more appropriate values. E.g. > 0x7fffffff or < 10

See also the L<common options|Win32::GUI::Reference::Options>.

=for comment $Id: per_package_method.tpl,v 1.3 2006/03/16 21:11:13 robertemay Exp $

=head2 Interval

B<Interval(ELAPSE)>

Get or set the periodic timer interval. Unit: ms
When setting a new interval, any existing timer is reset.  When setting
returns the previous interval.

Setting ELAPSE to 0 suspends the timer (i.e. it will not fire timer events).
The timer can be restarted later by setting ELAPSE to a positive value.

Note: Different OS versions might change too low or large intervals for ELAPSE
to more appropriate values. E.g. > 0x7fffffff or < 10

=for comment $Id: per_package_method.tpl,v 1.3 2006/03/16 21:11:13 robertemay Exp $

=head2 Kill

B<Kill([REMOVE=0])>

Remove the periodic timer event.

Kill() with no parameters, or a False parameter suspends the timer,
exactly as $timer->Interval(0); In this case it return the previous
interval.

Kill() with a True parameter will stop and remove all traces of the timer.
To use system resources efficiently, applications should Kill(1)
timers that are no longer necessary.




=for comment $Id: per_package_event_section.tpl,v 1.3 2006/03/16 21:11:13 robertemay Exp $

=head1 EVENTS

L<Common events|Win32::GUI::Reference::Events> apply to most windows and controls.





=for comment $Id: pod_postamble.tpl,v 1.2 2005/08/03 21:45:59 robertemay Exp $

=head1 VERSION

Documentation for Win32::GUI v1.04 created 29 Oct 2006

This document is autogenerated by the build process. Edits made here will be lost.
Edit F<docs/per_package.tpl> instead.

=head1 SUPPORT

Homepage: L<http://perl-win32-gui.sourceforge.net/>.

For further support join the users mailing list(C<perl-win32-gui-users@lists.sourceforge.net>) from the website
at L<http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users>.  There is a searchable list archive at L<http://sourceforge.net/mail/?group_id=16572>.

=head1 COPYRIGHT and LICENCE

Copyright (c) 1997..2006 Aldo Calpini. All rights reserved.

This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.


