Hello. I've been having some problems with wx.EVT_IDLE on OSX. Here is my test script:
import wx
import time
class Frame(wx.Frame):
def __init__(self):
super(Frame, self).__init__(None, wx.ID_ANY, 'Test')
self.t0 = time.time()
self.Bind(wx.EVT_IDLE, self.OnIdle)
def OnIdle(self, event):
print 'IDLE %d' % int(1000 * (time.time() - self.t0))
self.t0 = time.time()
event.Skip()
class App(wx.App):
def OnInit(self):
Frame().Show()
return True
App(0).MainLoop()
According to the documentation, OnIdle should be called once. What happens is that
1) On all platforms, OnIdle is called after every mouse move. No problem here, the event queue is empty then.
2) Then, on OS X only, it's called every second. Twice.
Tested on OS X 10.8.3 with Python 2.7 and wxPython 2.8.12.1 (mac-unicode). Is there any proper way to be notified only once ? I can work around it but I'd rather not
BTW it behaves the same if I comment out event.Skip().
Cheers
Jérôme Laheurte