# HG changeset patch # User Björn Ricks # Date 1365752260 -7200 # Node ID dd575513ee1bcf73bdbd771b327422bc92ce46e0 # Parent 822c4facbb6517adb15b34bff6609c65c4edf672 Add new State method set_focus With most state changes a focus must be set to a different widget to receive the keyinput. This change will allow to override the set_focus method which is called when the State is created. diff -r 822c4facbb65 -r dd575513ee1b getan/states.py --- a/getan/states.py Fri Apr 12 09:36:03 2013 +0200 +++ b/getan/states.py Fri Apr 12 09:37:40 2013 +0200 @@ -40,6 +40,7 @@ self.controller = controller self.view = view self.config = controller.get_config() + self.set_focus() def input_filter(self, input, raw): """Filters input that should not be passed to widget elements @@ -63,6 +64,10 @@ def msg(self, key): return self.messages[key] + def set_focus(self): + """ Override this method to set the focus when the state is created """ + pass + class ProjectState(State):