kivy/examples/application/app_with_kv_in_template1.py

27 lines
658 B
Python
Raw Normal View History

2011-06-19 17:42:40 +00:00
'''
Application from a .kv in a Template Directory
==============================================
This example shows how you can change the directory for the .kv file. You
should see "Hello from template1/test.ky" as a button.
As kivy instantiates the TestApp subclass of App, the variable kv_directory
is set. Kivy then implicitly searches for a .kv file matching the name
of the subclass in that directory, finding the file template1/test.kv. That
file contains a root of class Widget.
2011-06-19 17:42:40 +00:00
2011-06-19 17:42:40 +00:00
'''
import kivy
kivy.require('1.0.7')
from kivy.app import App
2011-06-19 17:42:40 +00:00
class TestApp(App):
2011-06-19 17:42:40 +00:00
kv_directory = 'template1'
if __name__ == '__main__':
2011-06-19 17:42:40 +00:00
TestApp().run()