这是我的t.py
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
class Simple(BoxLayout):
def __init__(self, **kwargs):
super(Simple, self).__init__(**kwargs)
# THIS IS SIMLE EXAMPLE, IN PRACTICE I AM READING VALUE FROM TEXT FILE
self.sometext = 'Hello from Init.'
def set_text(self):
return self.sometext # error: 'Simple' object has no attribute 'sometext'
#return "Hello World from Simple(BoxLayout)" # this is working
class TApp(App):
def build(self):
return Simple()
TApp().run()
我的t.kv
^{pr2}$所以这没用 需要做些什么才能让它工作?在
我希望这是可能的。。。在
谢谢
以下是我在kivy邮件列表中的回复:
链接的示例代码是:
相关问题 更多 >
编程相关推荐