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

Skip to content

Commit d281296

Browse files
committed
Merge pull request #4236 from ffteja/patch2
FIX : multiple canvas support for Windows Correctly dispatch scroll wheel events in Tk on MS/windows
2 parents 66c5aa6 + b9da9e5 commit d281296

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,14 @@ def __init__(self, figure, master=None, resize_callback=None):
246246
# event to the window containing the canvas instead.
247247
# See http://wiki.tcl.tk/3893 (mousewheel) for details
248248
root = self._tkcanvas.winfo_toplevel()
249-
root.bind("<MouseWheel>", self.scroll_event_windows)
249+
root.bind("<MouseWheel>", self.scroll_event_windows, "+")
250250

251251
# Can't get destroy events by binding to _tkcanvas. Therefore, bind
252252
# to the window and filter.
253253
def filter_destroy(evt):
254254
if evt.widget is self._tkcanvas:
255255
self.close_event()
256-
root.bind("<Destroy>", filter_destroy)
256+
root.bind("<Destroy>", filter_destroy, "+")
257257

258258
self._master = master
259259
self._tkcanvas.focus_set()

0 commit comments

Comments
 (0)