Wxpython timer event interval

I am trying to write a gui application using wx python and I need to control the interval of the timer event. Here is my code:

self.timer = wx.Timer(self)
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)        
self.timer.Start(750) # start timer after a delay

This is the correct structure, but I cannot control the interval or frequency of EVT_TIMER. I tried to figure out using the wx TimerEvent class, but with no luck. I feel this should be what I need, but it doesn't work:

self.timer = wx.Timer(self)
self.timerEvent = wx.TimerEvent(self.timer.GetId(),10)
self.Bind(wx.EVT_TIMER, self.on_timer, self.timer) 

Thank!

+3
source share
2 answers

, . , . . , 1000 = 1 . wx.TimerEvent. , .

, 750 . , , , .

+6

, , EVT_TIMER, , boolean oneShot. False, - self.timer.Start(milliseconds = 750, oneShot = True), , self.timer.Stop().

.

+2

All Articles