wishlist: "q" or "Ctrl-q" should close the window

+1 for 'q', it's the one gnuplot keybinding I forgot to

    > mention to John in a private message yesterday about
    > further gnuplot keybindings.

FYI, in case you want to experiment with various keybindins, in
backend_bases.py the FigureManagerBase.key_press method can be easily
extended. Eg, to bind 'q' to close the window

    def key_press(self, event):

        # these bindings happen whether you are over an axes or not
        if event.key == 'q':
            self.destroy() # how cruel to have to destroy oneself!
            return
        
        if event.inaxes is None: return
        
        # the mouse has to be over an axes to trigger these
        if event.key == 'g':
            event.inaxes.grid()
            self.canvas.draw()
        elif event.key == 'l':
            event.inaxes.toggle_log_lineary()
            self.canvas.draw()

I'd like to here from Steve, who along with Fernando is a resident UI
design expert, about whether this is a good idea. I'm still smarting
after he made me remove the close button from the toolbar :slight_smile:

JDH

John Hunter wrote:

I'd like to here from Steve, who along with Fernando is a resident UI
design expert, about whether this is a good idea. I'm still smarting
after he made me remove the close button from the toolbar :slight_smile:

Well, it's true that if there is no easy way to 'reopen' the window in its exact previous state, Ctrl-q might be a better solution. In gnuplot, an accidental close is just a 'replot' command away, so nothing is ever lost.

If no such thing can easily be done in pylab (like a reopen() command, or somesuch), it's perhaps safer to put a slight barrier in front of the closing command. In that case, Ctrl-w may be more UI-consistent, as Ctrl-q is generally used for closing a whole app, while Ctrl-w closes an individual window.

Best,

f

Hello,

···

On Tue, Feb 08, 2005 at 01:39:29PM -0700, Fernando Perez wrote:

Well, it's true that if there is no easy way to 'reopen' the window in its
exact previous state, Ctrl-q might be a better solution. In gnuplot, an
accidental close is just a 'replot' command away, so nothing is ever lost.

we could at least have "q" if show is run from a script
and more use the more complicated key presses only if it
is used interactively. This would be very convenient.

All the best,
Jochen
--