Explicitly pass touch events to child widgets (needed for kivy 1.7)
authorNeil <neil@dip.sun.ac.za>
Wed, 17 Jul 2013 16:19:18 +0000 (18:19 +0200)
committerNeil <neil@dip.sun.ac.za>
Wed, 17 Jul 2013 16:19:18 +0000 (18:19 +0200)
erdslangetjie/localwidgets.py

index 885ac51907ecfeb59f90f53c7f2c4a711946202e..fe719be7d2fcf0ef1de3f5bca0889f0d670ca207 100644 (file)
@@ -361,6 +361,17 @@ class LostScreen(Screen):
     START = 'Retry?'
 
 
+class MyScrollView(ScrollView):
+
+    def on_touch_down(self, touch):
+        for child in self.children:
+            child.on_touch_down(touch)
+
+    def on_touch_up(self, touch):
+        for child in self.children:
+            child.on_touch_up(touch)
+
+
 class GameApp(App):
 
     title = "Bane's Befuddlement"
@@ -400,7 +411,7 @@ class GameApp(App):
                 self.config, data=config_json)
 
     def build(self):
-        root = ScrollView(size_hint=(None, None))
+        root = MyScrollView(size_hint=(None, None))
         level_name = self.config.getdefault('bane', 'start_level', None)
         if level_name:
             self.levels.set_level_to(level_name)