On Mar 10, 2006, at 2:56 PM, Christopher Barker wrote:
> This might have something to do with the fact that OS-X double
> buffers it's windows, so you need to force and update event
> somehow. A call to wx.Window.Refresh() and/or wx.Window.Update()
> might do it.
For `examples/anim.py', calling line.axes.figure.canvas.Update()
after each call to pylab.draw() appears to do the trick.
> Maybe OS-X waits for a Idle event to update the screen.
The wxWidgets documentation for wxWindow::Refresh() and
wxWindow::Update() indicates that the event loop is the default
method for driving screen repaints.
> What kind of app would you have running without an event loop anyway?
Apparently, pylab scripts that try to animate plots by redrawing them
run without an event loop. I could be mistaken, but I don't think
the loop is started until you call pylab.show(). See `examples/
anim.py' for an example of what I'm talking about.
> Id didn't think you could do much at all without one in wx.
I didn't think so either but I hadn't considered pylab. Since a
matplotlib example was the initial source of the problem, I think we
should probably change things so that Update() gets called when
necessary. My proposal is to tack the following (untested) lines to
the end of backend_wx.FigureCanvasWx.gui_repaint():
# force a repaint if we think we're a pylab figure
if isinstance(self.GetParent(), FigureFrameWx):
self.Update()
Ken
|