wx.TimerEvent object is passed to the event handler of timer events (see 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')
See also
__init__ |
|
GetInterval |
Returns the interval of the timer which generated this event. |
GetTimer |
Returns the timer object which generated this event. |
wx.
TimerEvent
(Event)¶Possible constructors:
TimerEvent()
TimerEvent(timer)
TimerEvent object is passed to the event handler of timer events (see Timer.SetOwner).
GetInterval
(self)¶Returns the interval of the timer which generated this event.
Return type: | int |
---|
Interval
¶See GetInterval