gtk* bug

That looks correct.
I was confusing the event.area rectangle with the allocation rectangle.
For event.area x,y is relative to the widget and "x,y,x,y,w,h" works.
But self.allocation x,y is relative to the parent so you need
"0,0,0,0,w,h".

Steve

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

···

On Fri, 2005-08-05 at 20:28 -0700, matplotlib-devel-request@lists.sourceforge.net wrote:

        >>>>> "John" == John Hunter <jdhunter@...5...>
        writes:
        
            > I think we have a problem in GTK. In the script
        below, if
            > you add a button or some other widget above the
        figure
            > canvas, only a part of the canvas is updated in the
            > motion_notify_event update. The distance from the
        top of
            > the figure canvas to the part that is not updated is
        equal
            > to the height of the widget packed above the canvas.
        You
            > can observe this by resizing the window to make it
        taller or
            > shorter and noting the vertical extent where the
        horizontal
            > line disappears.
        
        I think the answer is
        
            def draw(self):
                # 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
        gtk_widget_queue_draw(),
                # which triggers an expose-event
                
                # GTK+ 2.x style draw()
                #self._need_redraw = True
                #self.queue_draw()
        
                # synchronous draw (needed for animation)
                x, y, w, h = self.allocation
                #print x, y, w, h
                self._pixmap_prepare (w, h)
                self._render_figure(self._pixmap, w, h)
                self._need_redraw = False
                self.window.draw_drawable
        (self.style.fg_gc[self.state],
                                           self._pixmap, 0, 0, 0, 0,
        w, h)
                                                         ^^^^^^^^^^