mirror of https://github.com/kivy/kivy.git
button: add text property
This commit is contained in:
parent
0cc55252db
commit
c46a70c49d
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue