Skip to content
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

Provide public access to the toolbar state for widget interaction #2694

Closed
jlaura opened this issue Dec 24, 2013 · 8 comments
Closed

Provide public access to the toolbar state for widget interaction #2694

jlaura opened this issue Dec 24, 2013 · 8 comments
Labels
MEP: MEP22 tool manager
Milestone

Comments

@jlaura
Copy link

jlaura commented Dec 24, 2013

Currently the state of the MPL toolbar is not publicly available and must be accessed via fig.canvas.manager.toolbar._active. Accessing via _active is dangerous as it is private and could potentially be altered without notice [link].(http://stackoverflow.com/questions/20711148/ignore-matplotlib-cursor-widget-when-toolbar-widget-selected/20712813#20712813.)

Is it possible to provide public access to the toolbar state so that widgets can 'fire' only when a toolbar item is not selected. As an example, if a cursor widget is used to generate subplots, it currently generates a subplot based on the point of an initial pan or zoom request (toolbar item).

@tacaswell

@tacaswell
Copy link
Member

@fariza Can you take a look at this?

@fariza
Copy link
Member

fariza commented Dec 27, 2013

This raises a very important point in the split of navigation and toolbar.

On the side of navigation there should be a public state. the api should allow to add/remove/disable/enable states.

On the toolbar side the buttons that respond to changes in the states should be converted to radio buttons. And again a new api to add/remove/etc... buttons.

Right after #2624 I will restart the discussion on this split, I will make sure this state handling is included.

@fariza
Copy link
Member

fariza commented Dec 27, 2013

@tacaswell Do you recommend doing the split based on a MEP? Or straight with a PR?

I am just asking to know what option have more chances of speedier review and approval.

@tacaswell
Copy link
Member

I am not sure the best way to do it. You can see how well my major re-factor is going with a straight PR.

Given that you are blocked by #2624, I think writing out a MEP with all the api details would be good because the discussion on that can happen in parallel.

@fariza
Copy link
Member

fariza commented Jan 7, 2014

@tacaswell I am working on the MEP for the split, please checkit out

https://github.com/matplotlib/matplotlib/wiki/Mep22

@fariza
Copy link
Member

fariza commented Jan 22, 2014

@tacaswell please add MEP22 label

@fariza
Copy link
Member

fariza commented Jan 24, 2014

In MEP22 #2759 NavigationBase class, there is a new method get_active that returns a dictionnary with the currently toggled tool, and a list of the registered tool instances

@fariza
Copy link
Member

fariza commented Aug 7, 2015

MEP22 solved this problem. fig.canvas.manager.toolmanager.active_toggle returns the currently toggled tools
I'm closing this issue, please reopen if necessary

@fariza fariza closed this as completed Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MEP: MEP22 tool manager
Projects
None yet
Development

No branches or pull requests

3 participants