8000 MultiCursor: make events connected during __init__ accessible (for later removal) by megies · Pull Request #2579 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MultiCursor: make events connected during __init__ accessible (for later removal) #2579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,18 @@ def __init__(self, canvas, axes, useblit=True, horizOn=False, vertOn=True,
else:
self.hlines = []

self.canvas.mpl_connect('motion_notify_event', self.onmove)
6318 self.canvas.mpl_connect('draw_event', self.clear)
self.connect()

def connect(self):
"""connect events"""
self._cidmotion = self.canvas.mpl_connect('motion_notify_event',
self.onmove)
self._ciddraw = self.canvas.mpl_connect('draw_event', self.clear)

def disconnect(self):
"""disconnect events"""
self.canvas.mpl_disconnect(self._cidmotion)
self.canvas.mpl_disconnect(self._ciddraw)

def clear(self, event):
"""clear the cursor"""
Expand Down
0