Class k.c.BaseController:

Part of kiwi.controllers

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

A generic controller that can be attached to any View

BaseController defines one public variable:

Function__init__

Creates a new controller, and attaches itself to a view. The

Functionon_key_press

The keypress handler, which dispatches keypresses to the

Functionget_parent

parent: the correspondent parent for the controller

Functionset_parent

parent: the correspondent parent for the controller

Functionget_view

view: the correspondent view for the controller

Functionset_view

view: the correspondent view for the controller

Functionset_keyactions

Sets the keyactions mapping. See the constructor

Functionupdate_keyactions

XXX

Function_get_all_methodsUndocumented
def __init__(self, view=None, keyactions=None):

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