Its difficult to say if its bug in backend_gtk.py, it depends on exactly
what your application is doing. You would need to post a minimal test
case that demonstrates the bug so we could see whats going on.
Send instant messages to your online friends http://au.messenger.yahoo.com
On Wed, 2006-02-15 at 20:36 -0800, email@example.com wrote:
I'm using matplotlib figures in several places at a time in my GTK
based app (means different page in a notebook).
I have trace a bug I partially solved but still doubting if it is a
matplotlib bug or a bad design of my app.
Here is the problem:
in matplotlib/backends/backend_gtk.py file, in
class FigureCanvasGTK (gtk.DrawingArea, FigureCanvasBase):
# synchronous window redraw (like GTK+ 1.2 used to do)
# Note: this does not follow the usual way that GTK redraws,
# which is asynchronous redraw using calls to
# which triggers an expose-event
# GTK+ 2.x style draw()
1- self._need_redraw = True
# synchronous draw (needed for animation)
2- x, y, w, h = self.allocation
2- if w<3 or h<3: return # empty fig
2- self._pixmap_prepare (w, h)
2- self._render_figure(self._pixmap, w, h)
2- self._need_redraw = False
2- self.window.draw_drawable (self.style.fg_gc[self.state],
2- self._pixmap, 0, 0, 0, 0, w, h)
If I use method 1- (and comment 2-) no problem, all run smoothly...
But using the default method, switching on method 2- (and comment 1-)
I get the followig error message when trying to redraw one of the
(the figure is plotted correctly the first time. No change made to the
figure, just redrawing...)
GtkWarning: gdk_pixmap_new: assertion `(drawable != NULL) || (depth !=
Traceback (most recent call last):
250, in draw
self._pixmap_prepare (w, h)
298, in _pixmap_prepare
RuntimeError: could not create GdkPixmap object
Somebody has a clue ???