【发布时间】:2020-03-19 05:33:07
【问题描述】:
我需要知道如何自定义已经实例化的对象。
#Archivo py
class Principal(ScreenManager):
def __init__(self, **kwargs):
super(Principal, self).__init__(**kwargs)
self._principal=Screen(name='Principal')
self._layout=AnchorLayout()
self._boton=Button(text='Hola')
self._layout.add_widget(self._boton)
self._principal.add_widget(self._layout)
self.add_widget(self._principal)
#Archivo kv
#:kivy 1.11.1
<Principal>:
root._boton.text:'hola2' #This line throws me error. How do I change the text of the button?
【问题讨论】:
-
请用英文在Stack Overflow提问。
标签: python widget kivy kivy-language