propagate on_touch_down to kids in Button and Label

This commit is contained in:
Qua-non 2012-03-01 01:58:57 +05:30
parent 402ad02514
commit 732f239b54
2 changed files with 4 additions and 0 deletions

View File

@ -111,6 +111,8 @@ class Button(Label):
self.state = 'normal'
def on_touch_down(self, touch):
if super(Button, self).on_touch_down(touch):
return True
if not self.collide_point(touch.x, touch.y):
return False
if self in touch.ud:

View File

@ -179,6 +179,8 @@ class Label(Widget):
self.texture_size = list(self.texture.size)
def on_touch_down(self, touch):
if super(Label, self).on_touch_down(touch):
return True
if not len(self.refs):
return False
tx, ty = touch.pos