Button¶
The button is a clickable node that fires a callback method when pressed or clicked.
Usage¶
The most basic button has a text label and a callback method for when it is pressed. The callback expects 1 argument, the instance of the button firing the event.
import toga
def my_callback(button):
# handle event
pass
button = toga.Button('Click me', on_press=my_callback)
Supported Platforms¶
Component | iOS | win32 | web | django | cocoa | gtk | android |
---|---|---|---|---|---|---|---|
Button |