-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
move NavigationToolbar2 canvas assignment to __new__ #5121
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
move NavigationToolbar2 canvas assignment to __new__ #5121
Conversation
Tests passed. Still needs review. |
What is wrong with just calling |
There is nothing wrong with that. In my case, I'm overwriting most of the functionality of the toolbar. Less attributes to look at would be nice if I choose to override Thanks for your speedy responses! |
For example, I'm not using the zoom/pan functionality nor the original home/back/forward functionality. Deciding if I should use |
If you are re-implementing that much of the internal details, I would not bother sub-classing. Just implement enough of the public API that it duck-types correctly. You should be aware of the work that @fariza and @OceanWolf have been doing to re-work the toolbar. |
Check the basic example |
@fariza Maybe. Is this GTK only or does it work with other backends? |
For the moment it works only with GTK3 and TK. |
Well, "this" release has already gone out... as a release candidate. The next feature release (probably in April) we will finalise the API and have it working on all of the other backends. Longer term we will depricate |
@tacaswell Very good point. I still believe not having to worry about the @fariza I'm using the Notebook backend. That does look nice for controlling toolbar items. @OceanWolf Thank for the info! |
There is also some ongoing work (see #4582) to convert the notebook backend to be a proper IPython widget. This will let you hook into with the rest of the IPython widget tools which may provide another path to getting the (I assume) richer toolbar you want. |
I am going to close this as bringing in @blbradley Thank you for your input and work, please be in touch about the toolbar refactor (the start of which will be in 1.5). Closing PRs without merging is one of the worst parts about being a maintainer 😞 . |
@tacaswell I'm sure I'll have to consider the refactor when I update my custom toolbar code. Thanks for all the info! |
Should prevent copy-paste of assignment of
canvas
andcanvas.toolbar
from__init__
when sublcassingNavigationToolbar2
.