Created
December 13, 2015 03:35
-
-
Save clayote/b8e9e45f02b128341048 to your computer and use it in GitHub Desktop.
on_touch_up getting called twice due to grab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.properties import NumericProperty | |
from kivy.uix.widget import Widget | |
from kivy.logger import Logger | |
from kivy.app import App | |
class TouchUpListener(Widget): | |
n = NumericProperty(0) | |
def on_touch_down(self, touch): | |
touch.grab(self) | |
def on_touch_up(self, touch): | |
Logger.info("TouchUpListener: on_touch_up #{}".format(self.n)) | |
self.n += 1 | |
class TouchUpTestApp(App): | |
def build(self): | |
return TouchUpListener() | |
if __name__ == '__main__': | |
TouchUpTestApp().run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment