Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Special thanks to toto_tico
- # http://stackoverflow.com/a/19881645
- from kivy.uix.button import Button
- from kivy.properties import BooleanProperty
- class ButtonEx(Button):
- enabled = BooleanProperty(True)
- def on_enabled(self, instance, value):
- if value:
- self.background_color = [1,1,1,1]
- self.color = [1,1,1,1]
- else:
- self.background_color = [1,1,1,.3]
- self.color = [1,1,1,.5]
- def on_touch_down( self, touch ):
- if self.enabled:
- return super(self.__class__, self).on_touch_down(touch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement