据说,我有这个。
class MainGui(App):
def build(self):
root = BoxLayout(orientation="vertical")
login_button = Button(text="Let's go")
login_button.bind(on_press = self.login)
login_button_area.add_widget(login_button)
root.add_widget(login_button_area)
def login(self, instance):
pass
现在,当点击login_button时,我想将整个布局更改为新布局。我该怎么做?
我试过这个
def login(self, instance):
root = BoxLayout(orientation='vertical')
textinput = TextInput(text='Hello world', multiline=False)
textinput.bind(on_text_validate=self.on_enter)
root.add_widget(textinput)
return root