Skip to content

Instantly share code, notes, and snippets.

@spinningD20
Created May 7, 2015 14:23
Show Gist options
  • Save spinningD20/9bee3529c34e1f402c11 to your computer and use it in GitHub Desktop.
Save spinningD20/9bee3529c34e1f402c11 to your computer and use it in GitHub Desktop.
child events fired on parent widget interaction
<PropertyTag>:
size_hint: (None, None)
size: tag_label.size
Label:
size: self.texture_size
on_touch_down: print(self.on_touch_down)
on_touch_up: print(self.on_touch_up)
id: tag_label
color: 0, 0, 0, 1
canvas.before:
Color:
rgba: root.background_color
Rectangle:
pos: self.pos
size: self.size
font_size: 24
text: root.tag_text
<NewOutline>:
name: 'New Outline'
FloatLayout:
PropertyTag:
PropertyTag:
PropertyTag:
PropertyTag:
PropertyTag:
PropertyTag:
PropertyTag:
class PropertyTag(Scatter):
red = .6, .2, .2, 1
green = .2, .6, .2, 1
gray = .5, .5, .5, .8
background_color = ListProperty(gray)
pressed_pos = ObjectProperty()
tag_text = StringProperty('unselected')
current_state = 'unselected'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment