Return True when we called a callback
authorStefano Rivera <stefano@rivera.za.net>
Sun, 11 May 2014 20:48:05 +0000 (22:48 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Sun, 11 May 2014 20:48:05 +0000 (22:48 +0200)
naja/widgets/base.py

index c82026179c9856b4812f6937d433881a8321fddc..ee6190b91939bdd35176e11257fc570ac2a78adf 100644 (file)
@@ -39,7 +39,7 @@ class Widget(object):
             self._prepared = False
             return False
         if SelectEvent.matches(ev) or ev.type == pgl.MOUSEBUTTONDOWN:
-            self.callback('click')
+            return self.callback('click')
         return False
 
     def add_callback(self, event, callback):
@@ -48,6 +48,7 @@ class Widget(object):
     def callback(self, event):
         for callback in self.callbacks[event]:
             callback(event)
+        return bool(self.callbacks[event])
 
 
 class Container(object):