python import toga def button_handler(widget): label.text = "Hello, Toga!" def build(app): box = toga.Box() button = toga.Button('Click me!', on_press=button_handler) box.add(button) global label label = toga.Label('Welcome to Toga!') box.add(label) return box app = toga.App('MyApp', 'org.beeware.myapp', startup=build) app.main_loop()


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