button: add text property

This commit is contained in:
Mathieu Virbel 2010-11-05 22:48:25 -04:00
parent 0cc55252db
commit c46a70c49d
1 changed files with 3 additions and 1 deletions

View File

@ -5,12 +5,14 @@ Button:
__all__ = ('Button', )
from kivy.uix.widget import Widget
from kivy.c_ext.properties import OptionProperty
from kivy.c_ext.properties import OptionProperty, StringProperty
class Button(Widget):
state = OptionProperty('normal', options=('normal', 'down'))
text = StringProperty('Hello')
def __init__(self, **kwargs):
super(Button, self).__init__(**kwargs)
self.register_event_type('on_press')