2011-06-19 17:42:40 +00:00
|
|
|
'''
|
2015-02-12 04:00:30 +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
|
2015-02-12 04:43:21 +00:00
|
|
|
is set. Kivy then implicitly searches for a .kv file matching the name
|
2015-02-12 04:00:30 +00:00
|
|
|
of the subclass in that directory, finding the file template1/test.kv. That
|
2015-03-23 20:56:34 +00:00
|
|
|
file contains the root widget.
|
2011-06-19 17:42:40 +00:00
|
|
|
|
2014-01-26 09:11:03 +00:00
|
|
|
|
2011-06-19 17:42:40 +00:00
|
|
|
'''
|
|
|
|
|
|
|
|
import kivy
|
|
|
|
kivy.require('1.0.7')
|
|
|
|
|
2011-04-19 09:46:27 +00:00
|
|
|
from kivy.app import App
|
|
|
|
|
2011-06-19 17:42:40 +00:00
|
|
|
|
2011-04-19 09:46:27 +00:00
|
|
|
class TestApp(App):
|
2011-06-19 17:42:40 +00:00
|
|
|
kv_directory = 'template1'
|
2011-04-19 09:46:27 +00:00
|
|
|
|
2016-12-17 07:50:52 +00:00
|
|
|
|
2011-04-19 09:46:27 +00:00
|
|
|
if __name__ == '__main__':
|
2011-06-19 17:42:40 +00:00
|
|
|
TestApp().run()
|