Many thanks (again) to Matt for his suggestions - I had a "D'oh" moment
when it was pointed out where I was calling the update from.
Matt's solution works on OS X, but I'm afraid I didn't specify what my
goal was particularly well. I'm aiming to dynamically update a
matplotlib plot embedded within a wx.Panel (or wx.Frame) from another
object, whose internal state is changing so that the calling object's
internal state is reflected in the matplotlib plot. The wx.Timer
solution doesn't seem appropriate for that (though if I'm wrong, I'm
happy to take advice).
After some reading around, I worked up two alternatives for updating the
plot from another object.
1) wx.Timer, as per Matt
2) Loop, and pass the value of the loop counter
3) A custom wx event, bound to the update method
The code at http://widdowquinn.pwp.blueyonder.co.uk/wxtest.py implements
all three methods, and how effective they are appears to be OS-
The wx.Timer method works on Windows (XP SP2), Linux (FC3) and OS X
The Loop method and custom event methods work fine on Windows. On
Linux, they dynamically update the plot, but not the button label. On
OS X, they do nothing, and only appear to update the plot after the
Does anyone here have any ideas on how I could progress further on
getting this to run, and update correctly under OS X? Or should I go
and bug the wxPython-Users list about it?
For info, all three systems are using Python 2.3.5., matplotlib 0.73.1,
and wxPython 184.108.40.206.
Dr Leighton Pritchard AMRSC
D131, Plant-Pathogen Interactions, Scottish Crop Research Institute
Invergowrie, Dundee, Scotland, DD2 5DA, UK
T: +44 (0)1382 562731 x2405 F: +44 (0)1382 568578
E: lpritc@...539... W: http://bioinf.scri.sari.ac.uk/lp
GPG/PGP: FEFC205C E58BA41B http://www.keyserver.net
(If the signature does not verify, please remove the SCRI disclaimer)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
This email is from the Scottish Crop Research Institute, but the views
expressed by the sender are not necessarily the views of SCRI and its
subsidiaries. This email and any files transmitted with it are confidential
to the intended recipient at the e-mail address to which it has been
addressed. It may not be disclosed or used by any other than that addressee.
If you are not the intended recipient you are requested to preserve this
confidentiality and you must not use, disclose, copy, print or rely on this
e-mail in any way. Please notify postmaster@...539... quoting the
name of the sender and delete the email from your system.
Although SCRI has taken reasonable precautions to ensure no viruses are
present in this email, neither the Institute nor the sender accepts any
responsibility for any viruses, and it is your responsibility to scan the email
and the attachments (if any).