Normally only the main thread should alter the graphics - you'll have
crashes if you try to do it otherwise. If you want to perform calculations in
a separate thread to keep the GUI responsive, you have to send an event from
the working thread to the main thread, so that the main thread does the GUI
update.
http://docs.wxwidgets.org/stable/wx_wxthreadoverview.html#wxthreadoverview
Well, at least that's the story from my C++ wx knowledge, but it is
probably still valid in Python.
Another interesting read from the samples page:
http://docs.wxwidgets.org/trunk/page_samples.html#page_samples_thread
Maybe simply using wxMutexGUIEnter() / wxMutexGUILeave() will sort your
problems, but I've not tried this method.
Vincent
···
On dimanche 05 octobre 2008, jcarnes wrote:
I am writing a GUI application in wxPython and using MPL that plots
figures, saves them to image files, and then closes them all from within a
thread to keep the GUI responsive.
--
Vincent Favre-Nicolin
CEA Grenoble/INAC/SP2M http://inac.cea.fr
Univ. Joseph Fourier (Grenoble) http://www.ujf-grenoble.fr
ObjCryst & Fox http://objcryst.sf.net/Fox