Button

../_images/button-preview.png

Widget description

This is a push-button. Press it and run some function. It can contain a simple label and icon object and it also has an autorepeat feature.

Available styles

  • default a normal button.
  • anchor Like default, but the button fades away when the mouse is not over it, leaving only the text or icon.
  • hoversel_vertical Internally used by Hoversel to give a continuous look across its options.
  • hoversel_vertical_entry Another internal for Hoversel.
  • naviframe Internally used by Naviframe for its back button.
  • colorselector Internally used by Colorselector for its left and right buttons.

Layout content parts

  • icon - An icon of the button

Layout text parts

  • default - Label of the button

Emitted signals

  • clicked: the user clicked the button (press/release).
  • repeated: the user pressed the button without releasing it.
  • pressed: button was pressed.
  • unpressed: button was released after being pressed.
  • focused : When the button has received focus. (since 1.8)
  • unfocused : When the button has lost focus. (since 1.8)

Inheritance diagram

Inheritance diagram of Button

class efl.elementary.Button(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.LayoutClass

Parameters:
  • parent (efl.evas.Object) – The parent object
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
autorepeat

Turn on/off the autorepeat event generated when the button is kept pressed

When off, no autorepeat is performed and buttons emit a normal clicked signal when they are clicked.

When on, keeping a button pressed will continuously emit a repeated signal until the button is released. The time it takes until it starts emitting the signal is given by autorepeat_initial_timeout, and the time between each new emission by autorepeat_gap_timeout.

Type:bool
autorepeat_gap_timeout

The interval between each generated autorepeat event

After the first repeated event is fired, all subsequent ones will follow after a delay of t seconds for each.

Type:float
autorepeat_gap_timeout_get()
autorepeat_gap_timeout_set(t)
autorepeat_get()
autorepeat_initial_timeout

The initial timeout before the autorepeat event is generated

Reflects the timeout, in seconds, since the button is pressed until the first repeated signal is emitted. If t is 0.0 or less, there won’t be any delay and the event will be fired the moment the button is pressed.

Type:float
autorepeat_initial_timeout_get()
autorepeat_initial_timeout_set(t)
autorepeat_set(on)
callback_clicked_add(func, *args, **kwargs)

The user clicked the button (press/release).

callback_clicked_del(func)
callback_focused_add(func, *args, **kwargs)

When the button has received focus.

New in version 1.8.

callback_focused_del(func)
callback_pressed_add(func, *args, **kwargs)

The button was pressed.

callback_pressed_del(func)
callback_repeated_add(func, *args, **kwargs)

The user pressed the button without releasing it.

callback_repeated_del(func)
callback_unfocused_add(func, *args, **kwargs)

When the button has lost focus.

New in version 1.8.

callback_unfocused_del(func)
callback_unpressed_add(func, *args, **kwargs)

The button was released after being pressed.

callback_unpressed_del(func)