Identifying current timer state

You can tell the timer's current state with the method IsRunning() and the current interval with the method GetInterval(). The method IsOneShot() will return True if the timer is running and is set to only fire once.

The wx.TimerEvent instance is nearly identical to its parent wx.Event class, but it does include a wx.GetInterval() method to return the interval of the timer in question. Using the event method GetId() returns the timer ID, in case you have bound events from multiple timers to the same handler and want to do different actions based on the specific timer which is firing.

Was this article helpful?

0 0

Post a comment