8000 Add set_cursor method to FigureCanvasTk · matplotlib/matplotlib@c540af5 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c540af5

Browse files
committed
Add set_cursor method to FigureCanvasTk
1 parent 075067c commit c540af5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@ def stop_event_loop(self):
387387
self._event_loop_id = None
388388
self._tkcanvas.quit()
389389

390+
def set_cursor(self, cursor):
391+
try:
392+
self._tkcanvas.configure(cursor=cursord[cursor])
393+
except tkinter.TclError:
394+
pass
395+
390396

391397
class FigureManagerTk(FigureManagerBase):
392398
"""
@@ -629,13 +635,6 @@ def remove_rubberband(self):
629635
lastrect = _api.deprecated("3.6")(
630636
property(lambda self: self.canvas._rubberband_rect))
631637

632-
def set_cursor(self, cursor):
633-
window = self.canvas.get_tk_widget().master
634-
try:
635-
window.configure(cursor=cursord[cursor])
636-
except tkinter.TclError:
637-
pass
638-
639638
def _set_image_for_button(self, button):
640639
"""
641640
Set the image for a button based on its pixel size.

0 commit comments

Comments
 (0)
0