diff browser_side/dialog.py @ 92:dd54bc13ac81

browser side: widgets' width and height can now be fixed + tarot game position fix
author Goffi <goffi@goffi.org>
date Tue, 28 Jun 2011 03:43:48 +0200
parents 9729ed7171a6
children 907a72e79b3e
line wrap: on
line diff
--- a/browser_side/dialog.py	Tue Jun 28 02:20:02 2011 +0200
+++ b/browser_side/dialog.py	Tue Jun 28 03:43:48 2011 +0200
@@ -285,6 +285,11 @@
     def _callListeners(self):
         for listener in self.valueChangedListener:
             listener(self.value)
+
+    def setValue(self, value):
+        """Change the value and fire valueChange listeners"""
+        self.value = value
+        self._callListeners()
     
     def onMinus(self, sender):
         self.value=max(0,self.value-1)
@@ -301,7 +306,7 @@
     def onInput(self, sender):
         """Accept only valid integer && normalize print (no leading 0)"""
         try:
-            self.value = int(self.box.getText())
+            self.value = int(self.box.getText()) if self.bot.getText() else 0 
         except ValueError:
             pass
         if self.value_max: