changeset 276:dd575513ee1b

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.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 12 Apr 2013 09:37:40 +0200
parents 822c4facbb65
children 3d6315be2251
files getan/states.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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):
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)