from kivy.app import App
from kivy.uix.screenmanager import ScreenManager
from kivy.properties import StringProperty
from kivy.uix.anchorlayout import AnchorLayout
from kivy.uix.button import Button
class Principal(ScreenManager):
text_button = StringProperty('Valor por defecto')
def __init__(self, **kwargs):
super(Principal, self).__init__(**kwargs)
self._principal=Screen(name='Principal')
self._layout=AnchorLayout()
self._boton=Button(text=self.text_button)
self._layout.add_widget(self._boton)
self._principal.add_widget(self._layout)
self.add_widget(self._principal)
class TestApp(App):
def build(self):
return Principal()
if __name__ == '__main__':
TestApp().run()