Tizen Native API  7.0

The check widget allows for toggling a value between true and false.

check_inheritance_tree.png

Check objects are a lot like radio objects in layout and functionality, except they do not work as a group, but independently, and only toggle the value of a boolean between false and true. elm_check_state_set() sets the boolean state and elm_check_state_get() returns the current state. For convenience, like the radio objects, you can set a pointer to a boolean directly with elm_check_state_pointer_set() for it to modify.

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

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

  • "changed" - This is called whenever the user changes the state of the check objects (event_info is always NULL).
  • "focused" - When the check has received focus. (since 1.8)
  • "unfocused" - When the check has lost focus. (since 1.8)
  • "language,changed" - the program's language changed (since 1.9)

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

  • "icon" - An icon of the check

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

  • "default" - A label of the check
  • "on" - On state label of the check (only valid for "toggle" style.)
  • "off" - Off state label of the check (only valid for "toggle" style.)

Supported elm_object common APIs.

Check example should give you a firm grasp of how to use this widget.

Functions

Evas_Objectelm_check_add (Evas_Object *parent)
 Add a new Check object.
Eina_Bool elm_check_state_get (const Evas_Object *obj)
 Get the state of the check object.
void elm_check_state_set (Evas_Object *obj, Eina_Bool state)
 Set the on/off state of the check object.
void elm_check_state_pointer_set (Evas_Object *obj, Eina_Bool *statep)
 Set a convenience pointer to a boolean to change.

Function Documentation

Add a new Check object.

Parameters:
parentThe parent object
Returns:
The new object or NULL if it cannot be created
Since :
2.3
Examples:
bg_example_03.c, check_example_01.c, entry_example.c, fileselector_button_example.c, fileselector_entry_example.c, fileselector_example.c, general_funcs_example.c, gengrid_example.c, mapbuf_example.c, transit_example_03.c, and transit_example_04.c.

Get the state of the check object.

Parameters:
objThe check object
Since :
2.3
Examples:
bg_example_03.c, entry_example.c, gengrid_example.c, and mapbuf_example.c.
void elm_check_state_pointer_set ( Evas_Object obj,
Eina_Bool statep 
)

Set a convenience pointer to a boolean to change.

This sets a pointer to a boolean, that, in addition to the check objects state will also be modified directly. To stop setting the object pointed to simply use null as the "statep" parameter. If "statep" is not null, then when this is called, the check objects state will also be modified to reflect the value of the boolean "statep" points to, just like calling @.state.set.

Parameters:
objThe check object
stateppointer to the boolean to modify
Since :
2.3
Examples:
check_example_01.c, general_funcs_example.c, transit_example_03.c, and transit_example_04.c.
void elm_check_state_set ( Evas_Object obj,
Eina_Bool  state 
)

Set the on/off state of the check object.

This sets the state of the check. If set with @.state_pointer.set, the state of that variable is also changed. Calling this doesn't cause the "changed" signal to be emitted.

Parameters:
objThe check object
stateThe state to use (1 == on, 0 == off)
Since :
2.3
Examples:
check_example_01.c, entry_example.c, fileselector_button_example.c, fileselector_entry_example.c, fileselector_example.c, gengrid_example.c, and mapbuf_example.c.