-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add a quit_all key to the default keymap #4921
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
Sorry to have let this sit here for so long. It seems like a good idea to me, but I'd like a little more feedback first in case there's something I'm missing. |
One thing I worry about with adding more default keys is possible On Tue, Oct 6, 2015 at 12:01 PM, Michael Droettboom <
|
I think the 2.0 release is a perfect release for new default keys, as there are already a lot of changes of the defaults planned. If not now for the 2.0 release, when? |
The problem I see is that 2.0 has been advertised as a style changing On Tue, Oct 6, 2015 at 1:35 PM, Thomas Hisch notifications@github.com
|
Note, with the new tool manager system coming down the pike, it will be On Tue, Oct 6, 2015 at 1:41 PM, Benjamin Root ben.v.root@gmail.com wrote:
|
I don't see any problems other than adding more What about adding it only in |
While I am normally a fan of foot-cannons, this strikes me as a potentially destructive one without a huge upside (like the sometimes default binding of 'ctrl-alt-backspace' to KILL MY X11 SESSION). |
I have zero problem with adding it only to toolmanager. Gives more reason On Tue, Oct 6, 2015 at 1:46 PM, Federico Ariza notifications@github.com
|
So I'll try to add it to the new toolmanager, if you are fine with it. Edit: To test it I have to use the GTK3 or the Tk backend, is this correct? |
yes, for the time being only those two backends are supported |
On 2015/10/06 6:01 AM, Michael Droettboom wrote:
I'm not a fan of extensive default key mappings. I was annoyed when |
@fariza I can't test the new toolbarmanager (with the tk backend) due to the following exception
It doesn't seem to be a problem with the tk package, because everything works fine with the old toolbar. |
@Thisch how are you testing it? I can't reproduce the problem |
I use conda and installed matplotlib from the latest git version with This simple command triggeres the exception
|
@fariza does the following example work for you?
edit: saving the png file as a gif seems to work ... hmm |
Your example works for me but I'm using 3.4 not 3.5. |
It even does not work with 3.4. I guess this is yet another problem with a conda package. Edit: I've just verified that it works with the tkinter version shipped with fedora. |
Maybe is the tkinter version. @tacaswell according to http://effbot.org/tkinterbook/photoimage.htm |
Isn't the tkinter version always tied to the python version? |
Maybe the conda tk package was not compiled with png support (@asmeurer) Edit: http://www.muonics.com/FreeStuff/TkPNG/
|
I think the time has come to create an "image selector" to load the appropriate image for each @tacaswell how are we handling the image selection for hpdi displays? Is there any ongoing effort to standardize this? |
@fariza can you reproduce the |
@Thisch sorry for the delay, I just tried with a windows7 with anaconda version 3.16.0 but |
@fariza, since the tk 8.6 package is neither available in the official anaconda repo nor in the 'anaconda cloud', I guess that your installed tk package is from a different source. Is this possible? Independently, this PR already contains the necessary class to be used with the 'toolmanager', right? |
@@ -2500,6 +2501,9 @@ def key_press_handler(event, canvas, toolbar=None): | |||
if event.key in quit_keys: | |||
Gcf.destroy_fig(canvas.figure) | |||
|
|||
if event.key in quit_all_keys: |
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.
I think we are going to leave it only inside toolmanager
, please remove it from backend_bases
@Thisch I think this is almost ready to go, just remove the |
@fariza done. Could you please test it, since my toolbarmanager setup still does not work. |
Add a quit_all key to the default keymap
@fariza, what needs to be done to have a working toolmanager implementation for the qt[45] backend? I'm interested in helping out. |
@Thisch we are waiting for MEP27 to be reviewed/merged before porting more backends, why you may ask? this is because MEP27 simplifies many things regarding window handling that is required for each backend. For the specific QT side of things, take a look at https://github.com/OceanWolf/matplotlib/tree/backend-refactor-qt I would recommend to contact @OceanWolf before going any further, maybe some of that code is outdated or maybe is done and just need review.... |
Hmm, I really don't like the usage of Gcf here, I specifically removed the import of If we really want this here, may I propose we import Gcf within in the tool, but I presume a better way exists to do this than through Gcf. How does this work for embeded applications that want to use the default toolbar and shortcut keys? It feels like something that they should have to take away... I think I would rather have the |
I don't like the idea of importing Gcf inside the tool. |
I think this is a really good point, and it points out a breakage in the On Wed, Jan 13, 2016 at 11:47 AM, OceanWolf notifications@github.com
|
@fariza conceptually the whole point of I have come to this conclusion while looking at the two backends where I can't see a way to get rid of |
The important thing is to get However, when you use I think this sort of dependency injection gets what everyone wants with minimal extra complications. exactly how we pick apart |
In this pull request, I have:
I have tested this on GNU/Linux with the mpl Qt4 backend.