Bug in matplotlib_gtk ? Still see some strange behavior...

Hi,
No more traceback with the matplolib cvs version.
However, I observe now some strange behavior.
I join a new example code.
When you launch the script and press replot button (circle
should become a line in both tab), then switch to the second tab
everything ok. But back to the first tab and press replot (line should
become a circle in both tab), switch to the second tab… still see a
line. If you use the “pan” tool in the toolbar and move a
bit the graph then the figure is the updated and become a circle.

Regards,

David

2006/2/20, Steve Chaplin <stevech1097@…49…>:

test_mpl_gtkagg2.py (1.35 KB)

···

On Sun, 2006-02-19 at 22:09 -0800, > matplotlib-devel-request@lists.sourceforge.net wrote:

Here is a quick and dirty minimal code reproducing the problem.

David
[snip …]

It is slightly obscure - why would you write a callback to display an
widget in a notebook tab which is not visible? However, the
FigureCanvasGTK should be able to handle this case so it is a bug.

The problem is with the “canvas2.draw()” line.
When you run the test the second canvas widget is not immediately
displayed, so it does not get realized() and its gdk.Window has not been
created which causes problems with code which uses the gdk.Window. The
expose_event() code checks for this case with
if GTK_WIDGET_DRAWABLE(self):
but FigureCanvasGTK.draw() was missing this check.

Its fixed now in CVS (I also simplified the draw() code a little).

Steve

Send instant messages to your online friends http://au.messenger.yahoo.com