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

Conversation

megies
Copy link
Contributor
@megies megies commented Nov 5, 2013

In a custom application where I repeatedly clear figures and reinitialize a MultiCursor object I need to inherit and override its __init__ method (which I now have to maintain with if/elses depending on installed matplotlib version because of changes in upstream, like 349ccec) because I need to disconnect the events again.
This would not have been necessary on my end had MultiCursor been aware of the IDs of its connected events. So, I think this might be useful for other people and it would make it possible for me to reuse __init__ for future matplotlib versions.

(Or maybe I just don't see the easy solution to disconnect these events again without saving their IDs?)

@tacaswell
Copy link
Member

👍

"""connect events"""
self.cidmotion = self.canvas.mpl_connect('motion_notify_event',
self.onmove)
self.ciddraw = self.canvas.mpl_connect('draw_event', self.clear)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these have leading _ ? They should not be public facing.

tacaswell added a commit that referenced this pull request Nov 14, 2013
MultiCursor: make events connected during __init__ accessible (for later removal)
@tacaswell tacaswell merged commit 40c263b into matplotlib:master Nov 14, 2013
@megies megies deleted the mutlicursor_store_connectors branch November 14, 2013 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0