Table Of Contents
See ButtonBehavior
for details.¶
Bases:
object
This mixin class provides
Button
behavior.Events: - on_press
Fired when the button is pressed.
- on_release
Fired when the button is released (i.e. the touch/click that pressed the button goes away).
The minimum period of time which the widget must remain in the ‘down’ state.
- ..warning::
- This is deprecated, and will be removed in the next major release.
Use
min_state_time
instead.
MIN_STATE_TIME
is a float and defaults to 0.035.
This determines whether or not the widget fires an on_release event if the touch_up is outside the widget.
New in version 1.9.0.
always_release
is aBooleanProperty
and defaults to True.
Contains the last relevant touch received by the Button. This can be used in on_press or on_release in order to know which touch dispatched the event.
New in version 1.8.0.
last_touch
is aObjectProperty
and defaults to None.
The minimum period of time which the widget must remain in the ‘down’ state.
New in version 1.9.1.
min_state_time
is a float and defaults to 0.035.
The state of the button, must be one of ‘normal’ or ‘down’. The state is ‘down’ only when the button is currently touched/clicked, otherwise its ‘normal’.
state
is anOptionProperty
and defaults to ‘normal’.
Trigger whatever action(s) have been bound to the button by calling both the on_press and on_release callbacks.
This simulates a quick button press without using any touch events.
Duration is the length of the press in seconds. Pass 0 if you want the action to happen instantly.
New in version 1.8.0.