2011-06-19 17:42:40 +00:00
|
|
|
'''
|
|
|
|
Application example using build() + return
|
|
|
|
==========================================
|
|
|
|
|
|
|
|
An application can be build if you return a widget on build(), or if you set
|
|
|
|
self.root.
|
|
|
|
'''
|
|
|
|
|
|
|
|
import kivy
|
|
|
|
kivy.require('1.0.7')
|
|
|
|
|
2011-01-31 16:42:41 +00:00
|
|
|
from kivy.app import App
|
|
|
|
from kivy.uix.button import Button
|
|
|
|
|
2011-06-19 17:42:40 +00:00
|
|
|
|
2011-01-31 16:42:41 +00:00
|
|
|
class TestApp(App):
|
2011-06-19 17:42:40 +00:00
|
|
|
|
2011-01-31 16:42:41 +00:00
|
|
|
def build(self):
|
2011-06-19 17:42:40 +00:00
|
|
|
# return a Button() as a root widget
|
2011-01-31 16:42:41 +00:00
|
|
|
return Button(text='hello world')
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
TestApp().run()
|