.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.TimerEvent:

==========================================================================================================================================
|phoenix_title|  **wx.TimerEvent**
==========================================================================================================================================

:ref:`wx.TimerEvent`  object is passed to the event handler of timer events (see :meth:`wx.Timer.SetOwner` ).          

For example: 

::

        class MyFrame(wx.Frame):

            def __init__(self, parent):

                wx.Frame.__init__(self, parent)

                self.timer = wx.Timer(self, TIMER_ID)
                self.Bind(wx.EVT_TIMER, self.OnTimer)

                self.timer.Start(1000)    # 1 second interval


            def OnTimer(self, event):

                # do whatever you want to do every second here
                print('Hello')









         



.. seealso:: :ref:`wx.Timer`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>TimerEvent</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.TimerEvent_inheritance.png" alt="Inheritance diagram of TimerEvent" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.TimerEvent.html" title="wx.TimerEvent" alt="" coords="5,160,125,189"/> <area shape="rect" id="node2" href="wx.Event.html" title="wx.Event" alt="" coords="24,83,107,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="22,5,109,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.TimerEvent.__init__`                                                  
:meth:`~wx.TimerEvent.GetInterval`                                               Returns the interval of the timer which generated this event.
:meth:`~wx.TimerEvent.GetTimer`                                                  Returns the timer object which generated this event.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.TimerEvent.Interval`                                                  See :meth:`~wx.TimerEvent.GetInterval`
:attr:`~wx.TimerEvent.Timer`                                                     See :meth:`~wx.TimerEvent.GetTimer`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.TimerEvent(Event)

   **Possible constructors**::

       TimerEvent(timer)
       
   
   TimerEvent object is passed to the event handler of timer events
   (see `Timer.SetOwner).`



   .. method:: __init__(self, timer)




      :param `timer`: 
      :type `timer`: wx.Timer







   .. method:: GetInterval(self)

      Returns the interval of the timer which generated this event.                  

      :rtype: `int`








   .. method:: GetTimer(self)

      Returns the timer object which generated this event.                  

      :rtype: :ref:`wx.Timer`








   .. attribute:: Interval

      See :meth:`~wx.TimerEvent.GetInterval`


   .. attribute:: Timer

      See :meth:`~wx.TimerEvent.GetTimer`

