The user will not be doing anything in the window except seeing the image data so this is unacceptable. How can I put this:
def OnIdle(self,event):
if not self.renderThread.isAlive():
print 'Starting thread to poll Mental Ray...'
self.renderThread = runMentalRayThread(filename,self)
self.renderThread.start()in the MainLoop() so that it continuously gets called as long as the window is opened?
I think you've misunderstood what an Idle event is. An Idle event gets triggered when the event stack *becomes* empty. Once triggered, that won't happen again until there are more events and they all get processed. If there are no more events, the stack does not become empty again.
Also, you'll get a LOT of Idle events when someone is, for instance, moving the mouse around, but not really doing anything -- you get a lot of events, it takes no time to process them, so the stack gets emptied a lot.
In short, you get a lot of Idle events when you don't want them, and none when you do. Personally, I've never found a use for them.
If you want to do some sort of continuous polling, you want a wx.Timer.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov