- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Functions
Button

## Macros
#define | elm_obj_button_admits_autorepeat_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_button_autorepeat_set(on) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET), EO_TYPECHECK(Eina_Bool, on)
#define | elm_obj_button_autorepeat_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET), EO_TYPECHECK(Eina_Bool *, ret)
#define | elm_obj_button_autorepeat_initial_timeout_set(t) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET), EO_TYPECHECK(double, t)
#define | elm_obj_button_autorepeat_initial_timeout_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET), EO_TYPECHECK(double *, ret)
#define | elm_obj_button_autorepeat_gap_timeout_set(t) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET), EO_TYPECHECK(double, t)
#define | elm_obj_button_autorepeat_gap_timeout_get(ret) ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET), EO_TYPECHECK(double *, ret)

## Functions
Evas_Object * | elm_button_add (Evas_Object *parent)
| Add a new button to the parent's canvas. More...
void | elm_button_autorepeat_set (Evas_Object *obj, Eina_Bool on)
| Turn on/off the autorepeat event generated when the button is kept pressed. More...
Eina_Bool | elm_button_autorepeat_get (const Evas_Object *obj)
| Get whether the autorepeat feature is enabled. More...
void | elm_button_autorepeat_initial_timeout_set (Evas_Object *obj, double t)
| Set the initial timeout before the autorepeat event is generated. More...
double | elm_button_autorepeat_initial_timeout_get (const Evas_Object *obj)
| Get the initial timeout before the autorepeat event is generated. More...
void | elm_button_autorepeat_gap_timeout_set (Evas_Object *obj, double t)
| Set the interval between each generated autorepeat event. More...
double | elm_button_autorepeat_gap_timeout_get (const Evas_Object *obj)
| Get the interval between each generated autorepeat event. More...

## Detailed 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.

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": 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) In all cases, the `event` parameter of the callback will be `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.
- 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.

Default content parts of the button widget that you can use for are:

- "icon" - An icon of the button

Default text parts of the button widget that you can use for are:

- "default" - Label of the button

Supported elm_object common APIs.

- elm_object_part_text_set
- elm_object_part_text_get
- elm_object_part_content_set
- elm_object_part_content_get
- elm_object_part_content_unset
- elm_object_signal_emit
- elm_object_signal_callback_add
- elm_object_signal_callback_del

Here is some sample code using it:

- Button - Hello, Button!
- Button - Complete example

## Macro Definition Documentation

#define elm_obj_button_admits_autorepeat_get | ( |  | ret | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_ADMITS_AUTOREPEAT_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

No description supplied by the EAPI.

Parameters

  [out] | ret |

See Also
  elm_button_admits_autorepeat_get

#define elm_obj_button_autorepeat_gap_timeout_get | ( |  | ret | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_GET), EO_TYPECHECK(double *, ret)

Since
  1.8

Get the interval between each generated autorepeat event

Parameters

  [out] | ret |

See Also
  elm_button_autorepeat_gap_timeout_get

Referenced by elm_button_autorepeat_gap_timeout_get().

#define elm_obj_button_autorepeat_gap_timeout_set | ( |  | t | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GAP_TIMEOUT_SET), EO_TYPECHECK(double, t)

Since
  1.8

Set the interval between each generated autorepeat event

Parameters

  [in] | t |

See Also
  elm_button_autorepeat_gap_timeout_set

Referenced by elm_button_autorepeat_gap_timeout_set().

#define elm_obj_button_autorepeat_get | ( |  | ret | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_GET), EO_TYPECHECK(Eina_Bool *, ret)

Since
  1.8

Get whether the autorepeat feature is enabled

Parameters

  [out] | ret |

See Also
  elm_button_autorepeat_get

Referenced by elm_button_autorepeat_get().

#define elm_obj_button_autorepeat_initial_timeout_get | ( |  | ret | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_GET), EO_TYPECHECK(double *, ret)

Since
  1.8

Get the initial timeout before the autorepeat event is generated

Parameters

  [out] | ret |

See Also
  elm_button_autorepeat_initial_timeout_get

Referenced by elm_button_autorepeat_initial_timeout_get().

#define elm_obj_button_autorepeat_initial_timeout_set | ( |  | t | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_INITIAL_TIMEOUT_SET), EO_TYPECHECK(double, t)

Since
  1.8

Set the initial timeout before the autorepeat event is generated

Parameters

  [in] | t |

See Also
  elm_button_autorepeat_initial_timeout_set

Referenced by elm_button_autorepeat_initial_timeout_set().

#define elm_obj_button_autorepeat_set | ( |  | on | ) | ELM_OBJ_BUTTON_ID(ELM_OBJ_BUTTON_SUB_ID_AUTOREPEAT_SET), EO_TYPECHECK(Eina_Bool, on)

Since
  1.8

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

Parameters

  [in] | on |

See Also
  elm_button_autorepeat_set

Referenced by elm_button_autorepeat_set().

## Function Documentation

Evas_Object* elm_button_add | ( | Evas_Object * | parent | ) |

Add a new button to the parent's canvas.

Parameters

  parent | The parent object

Returns
  The new object or NULL if it cannot be created

Referenced by elm_quicklaunch_seed().

double elm_button_autorepeat_gap_timeout_get | ( | const Evas_Object * | obj | ) |

Get the interval between each generated autorepeat event.

Parameters

  obj | The button object

Returns
  Interval in seconds

References elm_obj_button_autorepeat_gap_timeout_get.

void elm_button_autorepeat_gap_timeout_set | ( | Evas_Object * | obj,
|  | double | t
| ) |  |

Set 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.

Parameters

  obj | The button object
  t | Interval in seconds

See Also
  elm_button_autorepeat_initial_timeout_set()

References elm_obj_button_autorepeat_gap_timeout_set.

Eina_Bool elm_button_autorepeat_get | ( | const Evas_Object * | obj | ) |

Get whether the autorepeat feature is enabled.

Parameters

  obj | The button object

Returns
  EINA_TRUE if autorepeat is on, EINA_FALSE otherwise

See Also
  elm_button_autorepeat_set()

References elm_obj_button_autorepeat_get.

double elm_button_autorepeat_initial_timeout_get | ( | const Evas_Object * | obj | ) |

Get the initial timeout before the autorepeat event is generated.

Parameters

  obj | The button object

Returns
  Timeout in seconds

See Also
  elm_button_autorepeat_initial_timeout_set()

References elm_obj_button_autorepeat_initial_timeout_get.

void elm_button_autorepeat_initial_timeout_set | ( | Evas_Object * | obj,
|  | double | t
| ) |  |

Set the initial timeout before the autorepeat event is generated.

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 will be fired the moment the button is pressed.

Parameters

  obj | The button object
  t | Timeout in seconds

See Also
  elm_button_autorepeat_set()
  elm_button_autorepeat_gap_timeout_set()

References elm_obj_button_autorepeat_initial_timeout_set.

void elm_button_autorepeat_set | ( | Evas_Object * | obj,
|  | Eina_Bool | on
| ) |  |

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 elm_button_autorepeat_initial_timeout_set(), and the time between each new emission by elm_button_autorepeat_gap_timeout_set().

Parameters

  obj | The button object
  on | A bool to turn on/off the event

References elm_obj_button_autorepeat_set.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:12