Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30903ce

Browse files
author
Steve Chaplin
committed
'SC'
svn path=/trunk/matplotlib/; revision=1571
1 parent dd5d8fc commit 30903ce

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
New entries should be added at the top
22

3+
2005-07-28 backend_gtk.py: update FigureCanvasGTK.draw() (needed due to the
4+
recent expose_event() change) so that examples/anim.py works in the
5+
usual way - SC
6+
37
2005-07-26 Added new widgets Cursor and HorizontalSpanSelector to
48
matplotlib.widgets. See examples/widgets/cursor.py and
59
examples/widgets/span_selector.py - JDH

lib/matplotlib/backends/backend_gtk.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,22 @@ def configure_event(self, widget, event):
220220

221221

222222
def draw(self):
223-
self._need_redraw = True
224-
#self.expose_event(self, None)
225-
self.queue_draw()
223+
# synchronous window redraw (like GTK+ 1.2 used to do)
224+
# Note: this does not follow the usual way that GTK redraws,
225+
# which is asynchronous redraw using calls to gtk_widget_queue_draw(),
226+
# which triggers an expose-event
226227

228+
# GTK+ 2.x style draw()
229+
#self._need_redraw = True
230+
#self.queue_draw()
231+
232+
# synchronous draw (needed for animation)
233+
x, y, w, h = self.allocation
234+
self._pixmap_prepare (w, h)
235+
self._render_figure(self._pixmap, w, h)
236+
self._need_redraw = False
237+
self.window.draw_drawable (self.style.fg_gc[self.state],
238+
self._pixmap, x, y, x, y, w, h)
227239

228240

229241
def draw_idle(self):

0 commit comments

Comments
 (0)