Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99561

Customize in kv py object

$
0
0

What I need is to know how I do to customize an object already instantiated.

#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?

Viewing all articles
Browse latest Browse all 99561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>