| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…Agg into separate classes NavigationController2Wx/Agg to be used separately bug fix: add missing 'import six'
|
If your goal is to use the zoom/pan ability, you may be better served by the (poorly documented...) toolmanager API. |
Sorry, something went wrong.
|
I don't think the new toolmanager API has been implemented for Wx yet. This is a bit orthogonal to that work, but this is self-contained to the Wx backend and is backward compatible. I am 👍 on this going in as-is. |
Sorry, something went wrong.
|
@DietmarSchwertberger Thank you for your work on this. |
Sorry, something went wrong.
|
I was not aware of that. A cleaner and more straightforward approach with separation of functionality and GUI elements would be nice. The only documentation I found right now is stating that it's experimental and only in gtk3 and tk. For my wxGlade examples, I need to ship the restructured version anyway as I can't rely on anyone upgrading matplotlib immediately. |
Sorry, something went wrong.
|
fwiw I would much prefer updating the toolmanager API for wx. |
Sorry, something went wrong.
|
I had a look at the example and tried it with Tk instead of GTK as I'm using Windows. |
Sorry, something went wrong.
There was a problem hiding this comment.
👍 to change in theory.
Have not tested locally (and we have no CI on this). Strongly prefer second reviewer check this locally.
Sorry, something went wrong.
|
@DietmarSchwertberger Using the toolmanager you can achieve what you want, In your lager application you won't use the toolbar, but just the toolmanager that gives you access to all the tools without the need for the gui part. I agree that we are lacking documentation for the toolmanager, but have you checked https://matplotlib.org/api/backend_managers_api.html ? I would really prefer this to go in the direction of the ToolManager, if we all push in the same direction we can move forward. |
Sorry, something went wrong.
|
Would a PR be accepted that just implements these, i.e. without an actual tool or status bar implementation? SaveFigureWx SetCursorWx RubberbandWx ... backend_tools.ToolSaveFigure = SaveFigureWx #backend_tools.ToolConfigureSubplots = ConfigureSubplotsQt backend_tools.ToolSetCursor = SetCursorWx backend_tools.ToolRubberband = RubberbandWx |
Sorry, something went wrong.
|
Things seem to work fine with the tools copied from Qt and Tk implementations. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
plus bug fix: add missing 'import six'
PR Summary
When embedding a FigureCanvasWx or FigureCanvasWxAgg into a larger
application, the functionality of NavigationToolbar2Wx/Agg is quite useful,
but actually having to integrate the ToolBar is not too nice.
With this pull request you still can use the functionality (pan, zoom, save_figure etc.) now
as the non-ToolBar specific code is refactored into NavigationController2Wx/Agg.
I'm currently using this to prepare a more comprehensive example of a
matplotlib application to be supplied with wxGlade.
PR Checklist
I don't think that NavigationToolbar2Wx is documented anywhere except
in the examples. If anyone wants to use NavigationController2Wx/Agg, he/she
probably needs to look into the sources anyway.
If the pull request is accepted, I could prepare an example with
standard wx Buttons instead of the toolbar.