class controls.Button(BaseButton, Label)

A Button is a widget with a textual label which can be clicked with the mouse to trigger an action.

Constructor

Button(text, font = None, action = None, enable = None)
Initializes the button with the given text. The size of the button is determined by the text and the font or the default font from the theme. The action should be a callable object of no arguments; it will be called when the mouse is clicked and released again inside the button. If supplied, enable should be a function returning a boolean; it will be used to determine whether the button is enabled.

Theme Properties

highlight_color
Colour in which to display the text while mouse has been clicked but not yet released.
disabled_color
Colour in which to display the text when the widget is disabled.

Properties

enabled
True if the button is enabled. If no enable function was supplied in the constructor, this property may also be assigned in order to enable and disable the button.
---