Revision: 8466
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8466&view=rev
Author:   efiring
Date:     2010-06-24 21:17:30 +0000 (Thu, 24 Jun 2010)

Log Message:
-----------
backend_gtk: don't use idle events for draw_rubberband.
Use of idle events for draw_rubberband was a peculiarity of backend_gtk.
When using zoom-to-rect, it often caused a rubberband draw event
to occur after the canvas redraw at the end of the zoom, leaving
the canvas showing the state before the zoom action instead of
showing the result of the action.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py     2010-06-24 
18:25:16 UTC (rev 8465)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py     2010-06-24 
21:17:30 UTC (rev 8466)
@@ -611,11 +611,9 @@
         self.win = window
         gtk.Toolbar.__init__(self)
         NavigationToolbar2.__init__(self, canvas)
-        self._idle_draw_id = 0
 
     def set_message(self, s):
-        if self._idle_draw_id == 0:
-            self.message.set_label(s)
+        self.message.set_label(s)
 
     def set_cursor(self, cursor):
         self.canvas.window.set_cursor(cursord[cursor])
@@ -644,7 +642,8 @@
         h = abs(y1 - y0)
 
         rect = [int(val)for val in min(x0,x1), min(y0, y1), w, h]
-        try: lastrect, imageBack = self._imageBack
+        try:
+            lastrect, imageBack = self._imageBack
         except AttributeError:
             #snap image back
             if event.inaxes is None:
@@ -655,16 +654,9 @@
             b = int(height)-(b+h)
             axrect = l,b,w,h
             self._imageBack = axrect, drawable.get_image(*axrect)
-            drawable.draw_rectangle(gc, False, *rect)
-            self._idle_draw_id = 0
         else:
-            def idle_draw(*args):
-                drawable.draw_image(gc, imageBack, 0, 0, *lastrect)
-                drawable.draw_rectangle(gc, False, *rect)
-                self._idle_draw_id = 0
-                return False
-            if self._idle_draw_id == 0:
-                self._idle_draw_id = gobject.idle_add(idle_draw)
+            drawable.draw_image(gc, imageBack, 0, 0, *lastrect)
+        drawable.draw_rectangle(gc, False, *rect)
 
 
     def _init_toolbar(self):


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to