Package muntjac :: Package ui :: Module window :: Class CloseShortcut
[hide private]
[frames] | no frames]

Class CloseShortcut

source code

                      object --+            
                               |            
             event.action.Action --+        
                                   |        
event.shortcut_action.ShortcutAction --+    
                                       |    
                          object --+   |    
                                   |   |    
              event.action.IListener --+    
                                       |    
event.shortcut_listener.ShortcutListener --+
                                           |
                                          CloseShortcut

A ShortcutListener specifically made to define a keyboard shortcut that closes the window:

    # within the window using helper
    subWindow.setCloseShortcut(KeyCode.ESCAPE, NOne)

    # or globally
    getWindow().addAction(CloseShortcut(subWindow, KeyCode.ESCAPE))
Instance Methods [hide private]
 
__init__(self, *args)
Creates a keyboard shortcut for closing the given window using the shorthand notation defined in ShortcutAction or the given KeyCode and ModifierKeys.
source code
 
handleAction(self, sender, target) source code

Inherited from event.shortcut_action.ShortcutAction: getKeyCode, getModifiers

Inherited from event.action.Action: __eq__, getCaption, getIcon, setCaption, setIcon

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from event.shortcut_action.ShortcutAction: SHORTHAND_CHAR_ALT, SHORTHAND_CHAR_CTRL, SHORTHAND_CHAR_SHIFT

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args)
(Constructor)

source code 

Creates a keyboard shortcut for closing the given window using the shorthand notation defined in ShortcutAction or the given KeyCode and ModifierKeys.

Parameters:
  • args - tuple of the form
    • (window, shorthandCaption)
      1. to be closed when the shortcut is invoked
      2. the caption with shortcut keycode and modifiers indicated
    • (window, keyCode, modifiers)
      1. to be closed when the shortcut is invoked
      2. KeyCode to react to
      3. optional modifiers for shortcut
    • (window, keyCode)
      1. to be closed when the shortcut is invoked
      2. KeyCode to react to
Overrides: object.__init__

handleAction(self, sender, target)

source code 
Overrides: event.action.IListener.handleAction