python import toga class MyFirstApp(toga.App): def startup(self): main_box = toga.Box() main_box.add(label) button.on_press = self.button_handler main_box.add(button) self.main_window = toga.MainWindow(title=self.name) self.main_window.content = main_box self.main_window.show() def button_handler(self, widget): label = widget.parent.children[0] if __name__ == '__main__': app.main_loop()


上一篇:
下一篇:
切换中文