Tizen Native API

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.

button_inheritance_tree.png

This widget inherits from the Layout one, so that all the functions acting on it also work for button objects.

This widget emits the following signals, besides the ones sent from Layout :

  • "clicked": The user clicked the button (press/release).
  • "repeated": The user pressed the button without releasing it.
  • "pressed": The button is pressed.
  • "unpressed": The button is released after being pressed. In all cases, the event parameter of the callback is NULL.

Also, defined in the default theme, the button has the following styles available:

  • 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.
  • naviframe: Internally used by Naviframe for its back button. for its left and right buttons.

The default content parts of the button widget that you can use are:

  • "icon" - An icon of the button.

The default text parts of the button widget that you can use are:

  • "default" - Label of the button.

Supported common elm_object APIs.

Functions

Evas_Objectelm_button_add (Evas_Object *parent)
 Adds a new button to the parent's canvas.
void elm_button_autorepeat_set (Evas_Object *obj, Eina_Bool on)
 Turns on/off the autorepeat event generated when the button is kept pressed.
Eina_Bool elm_button_autorepeat_get (const Evas_Object *obj)
 Gets whether the autorepeat feature is enabled.
void elm_button_autorepeat_initial_timeout_set (Evas_Object *obj, double t)
 Sets the initial timeout before the autorepeat event is generated.
double elm_button_autorepeat_initial_timeout_get (const Evas_Object *obj)
 Gets the initial timeout before the autorepeat event is generated.
void elm_button_autorepeat_gap_timeout_set (Evas_Object *obj, double t)
 Sets the interval between each generated autorepeat event.
double elm_button_autorepeat_gap_timeout_get (const Evas_Object *obj)
 Gets the interval between each generated autorepeat event.

Function Documentation

Adds a new button to the parent's canvas.

Since :
2.3.1
Parameters:
[in]parentThe parent object
Returns:
The new object, otherwise NULL if it cannot be created

Gets the interval between each generated autorepeat event.

Since :
2.3.1
Parameters:
[in]objThe button object
Returns:
The interval in seconds
void elm_button_autorepeat_gap_timeout_set ( Evas_Object obj,
double  t 
)

Sets the interval between each generated autorepeat event.

Since :
2.3.1
Remarks:
After the first repeated event is fired, all subsequent ones follow after a delay of t seconds for each.
Parameters:
[in]objThe button object
[in]tThe interval in seconds
See also:
elm_button_autorepeat_initial_timeout_set()

Gets whether the autorepeat feature is enabled.

Since :
2.3.1
Parameters:
[in]objThe button object
Returns:
EINA_TRUE if autorepeat is on, otherwise EINA_FALSE
See also:
elm_button_autorepeat_set()

Gets the initial timeout before the autorepeat event is generated.

Since :
2.3.1
Parameters:
[in]objThe button object
Returns:
The timeout in seconds
See also:
elm_button_autorepeat_initial_timeout_set()

Sets the initial timeout before the autorepeat event is generated.

This sets 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 is fired the moment the button is pressed.

Since :
2.3.1
Parameters:
[in]objThe button object
[in]tThe timeout in seconds
See also:
elm_button_autorepeat_set()
elm_button_autorepeat_gap_timeout_set()

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

Since :
2.3.1
Remarks:
When off, no autorepeat is performed and buttons emit a normal clicked signal when they are clicked.
When on, keeping a button pressed continuously emits a repeated signal until the button is released. The time it takes until it starts emitting the signal is given by elm_button_autorepeat_initial_timeout_set(), and the time between each new emission is given by elm_button_autorepeat_gap_timeout_set().
Parameters:
[in]objThe button object
[in]onThe boolean value to turn on/off the event