-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
solution: All subclasses of LocationEvent could be used in cbook.callbacks before being fully initialized - issue 15139 #16948
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
Conversation
@anntzer I don't think this collides with #16931 (which will fix the same bug by not doing the processing in Thanks for this @Stefan-Mitic ! It looks like there are a couple of un-related commits on this branch. Could you please remove them? See https://matplotlib.org/devel/gitwash/development_workflow.html?highlight=rebase#rewriting-commit-history for instructions. Remember that when you push the re-written branch to github to not do what it suggests about merging and instead use |
I can handle the rebase, sure. |
4543d48
to
d99430e
Compare
Thanks for the help @tacaswell |
So if I read #15139 correctly, the same thing should be done for |
Yes @QuLogic, I added it to |
Can you add tests? I think it should work in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both cases, there should be a comment why the super-init call is deferred to the end. Usually it's in the first line and there's a danger that people will move it back later, or at least are confused why it's at the end.
@QuLogic, I'm not sure how to trigger a keypress event to invoke my callback function.
|
Co-authored-by: Tim Hoffmann <[email protected]>
I don't disagree, but we have the event system we have. With |
…nt could be used in cbook.callbacks before being fully initialized - issue 15139
…948-on-v3.2.x Backport PR #16948 on branch v3.2.x (solution: All subclasses of LocationEvent could be used in cbook.callbacks before being fully initialized - issue 15139)
PR Summary
Modified the call to LocationEvent.init() to be after MouseButton initialization in MouseEvent.init(). The reason for this is the error occurs because callback.process is invoked before the initialization.
MouseEvent is a subclass of LocationEvent, so it is safe to say that motion_notify_event() can be called by a child class of LocationEvent.
Issue Ref: #15139
PR Checklist