Erik Tollerud wrote:
> I tested this on 0.91.2 on Ubuntu Gutsy, and wx 2.8.7.1, and found
> that when I bring up a new window, I see a black canvas and it doesn't
> draw any of the matplotlib objects until I do something like resizing
> that must explicitly call a draw at some point.

yup, same here.

I'm using wxAgg, and FigureCanvas.draw() just doesn't seem to be getting 
called when I call Figure.draw()

It looks like it's designed to work the other way -- the Window needs to 
call self.figure.draw(self.renderer) when it wants the image drawn. 
There is an efficiency to this, as the figure doesn't get rendered until 
the GUI toolkit needs it. However, having it re-render on every Paint 
call isn't right either.

So how should this work? I'd like to be able to call Figure.draw(), and 
have the figure re-draw itself - but then it needs to be able to tell 
the backend Canvas that it needs to be drawn.

It seems that the figure needs to keep a flag that indicated when it is 
"dirty", then the paint handler could check that, and call draw if need 
be. Is there one already?

This all seems a bit awkward though. I've written a bunch of double 
buffered code, and I try to do it like this:

The Paint handler only blits.
There is a draw routine that actually draws the off-screen bitmap. It is 
called:
   - when the bitmap is new, like in a Re-size event
   - when the drawing changes.

In the MPL case, then, it seems that figure.draw() should call that draw 
routine, but maybe it doesn't know anything about its canvas. Ah -- ye 
sit does - figure.canvas.

OK, so a draw_event is getting called, which I guess is where the 
drawing should happen, but I'm getting lost now!

-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

[EMAIL PROTECTED]

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to