|
54 | 54 | cursors.HAND : gdk.Cursor(gdk.HAND2), |
55 | 55 | cursors.POINTER : gdk.Cursor(gdk.LEFT_PTR), |
56 | 56 | cursors.SELECT_REGION : gdk.Cursor(gdk.TCROSS), |
| 57 | + cursors.WAIT : gdk.Cursor(gdk.WATCH), |
57 | 58 | } |
58 | 59 |
|
59 | 60 | # ref gtk+/gtk/gtkwidget.h |
@@ -386,16 +387,20 @@ def _render_figure(self, pixmap, width, height): |
386 | 387 | def expose_event(self, widget, event): |
387 | 388 | """Expose_event for all GTK backends. Should not be overridden. |
388 | 389 | """ |
| 390 | + toolbar = self.toolbar |
| 391 | + if toolbar: |
| 392 | + toolbar.set_cursor(cursors.WAIT) |
389 | 393 | if GTK_WIDGET_DRAWABLE(self): |
390 | 394 | if self._need_redraw: |
391 | 395 | x, y, w, h = self.allocation |
392 | 396 | self._pixmap_prepare (w, h) |
393 | 397 | self._render_figure(self._pixmap, w, h) |
394 | 398 | self._need_redraw = False |
395 | | - |
396 | 399 | x, y, w, h = event.area |
397 | 400 | self.window.draw_drawable (self.style.fg_gc[self.state], |
398 | 401 | self._pixmap, x, y, x, y, w, h) |
| 402 | + if toolbar: |
| 403 | + toolbar.set_cursor(toolbar._lastCursor) |
399 | 404 | return False # finish event propagation? |
400 | 405 |
|
401 | 406 | filetypes = FigureCanvasBase.filetypes.copy() |
@@ -619,6 +624,7 @@ def set_message(self, s): |
619 | 624 |
|
620 | 625 | def set_cursor(self, cursor): |
621 | 626 | self.canvas.window.set_cursor(cursord[cursor]) |
| 627 | + gtk.main_iteration() |
622 | 628 |
|
623 | 629 | def release(self, event): |
624 | 630 | try: del self._pixmapBack |
|
0 commit comments