Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 751 Bytes

button.rst

File metadata and controls

36 lines (24 loc) · 751 Bytes

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

Reference

toga.interface.widgets.button.Button