# Class k.c.BaseController:

Part of kiwi.controllers View In Hierarchy

Known subclasses: kiwi.ui.delegates.Delegate, kiwi.ui.delegates.GladeDelegate, kiwi.ui.delegates.GladeSlaveDelegate, kiwi.ui.delegates.SlaveDelegate

A generic controller that can be attached to any View

BaseController defines one public variable:

- view: corresponds to a the associated View instance, which holds the UI implementation itself (widgets, layout, etc.)

Method | __init__ | Creates a new controller, and attaches itself to a view. The
Method | on_key_press | The keypress handler, which dispatches keypresses to the
Method | get_parent | parent: the correspondent parent for the controller
Method | set_parent | parent: the correspondent parent for the controller
Method | get_view | view: the correspondent view for the controller
Method | set_view | view: the correspondent view for the controller
Method | set_keyactions | Sets the keyactions mapping. See the constructor
Method | update_keyactions | XXX
Method | _get_all_methods | Undocumented

def __init__(self, view=None, keyactions=None):
overridden in kiwi.ui.delegates.Delegate, kiwi.ui.delegates.GladeDelegate, kiwi.ui.delegates.GladeSlaveDelegate, kiwi.ui.delegates.SlaveDelegate
Creates a new controller, and attaches itself to a view. The constructor triggers a view.set_constructor(self) call, so the view is also attached to it. The arguments are identical to the view and keyactions class variables.

- view: the correspondent view for the controller
- keyactions: a mapping from GDK key symbol (GDK.A, etc.) to a method. The method will be called when any relevant keypress is generated for that view. The handler definition should look like:

      >>> def my_A_handler(self, widget, event, args):

def on_key_press(self, widget, event):
The keypress handler, which dispatches keypresses to the functions mapped to in self.keyactions

def get_parent(self):
parent: the correspondent parent for the controller

def set_parent(self, parent):
parent: the correspondent parent for the controller

def get_view(self):
view: the correspondent view for the controller

def set_view(self, view):
view: the correspondent view for the controller

def set_keyactions(self, keyactions):
Sets the keyactions mapping. See the constructor documentation for a description of it.

def update_keyactions(self, new_actions):
XXX

def _get_all_methods(self, klass=None):
Undocumented