traitsui.key_bindings module¶
Defines KeyBinding and KeyBindings classes, which manage the mapping of keystroke events into method calls on controller objects that are supplied by the application.
-
traitsui.key_bindings.
Binding
= Str(editor=KeyBindingEditor())¶ Trait definition for key bindings
-
class
traitsui.key_bindings.
KeyBinding
[source]¶ Bases:
traits.has_traits.HasStrictTraits
Binds one or two keystrokes to a method.
-
binding1
= Binding¶ First key binding
-
binding2
= Binding¶ Second key binding
-
description
= Str()¶ Description of what application function the method performs
-
method_name
= Str()¶ Name of controller method the key is bound to
-
owner
= Instance("KeyBindings")¶ KeyBindings object that “owns” the KeyBinding
-
-
class
traitsui.key_bindings.
KeyBindings
(*bindings, **traits)[source]¶ Bases:
traits.has_traits.HasPrivateTraits
A set of key bindings.
-
bindings
= List(Instance(KeyBinding))¶ Set of defined key bindings (redefined dynamically)
-
children
= List(transient=True)¶ The child KeyBindings of this object (if any):
-
controllers
= List(transient=True)¶ The (optional) list of controllers associated with this KeyBindings object. The controllers may also be provided with the ‘do’ method:
-
parent
= Instance("KeyBindings", transient=True)¶ The ‘parent’ KeyBindings object of this one (if any):
-
prefix
= Str()¶ Optional prefix to add to each method name
-
root
= Property(observe="parent")¶ The root of the KeyBindings tree this object is part of:
-
suffix
= Str()¶ Optional suffix to add to each method name
-
-
class
traitsui.key_bindings.
KeyBindingsHandler
(model=None, **metadata)[source]¶ Bases:
traitsui.handler.ModelView