Check
PUBLISHED
The check UI component accepts user input by the method of toggling. It is similar to the radio [1] component, except that it does not work as a group. For more information, see the Check [2] API.
This feature is supported in wearable applications only.
Basic Usage
To use a check component in your application:
- Add a check component with the
elm_check_add()
function:Evas_Object *check; check = elm_check_add(parent);
- Set a style and fill the check component with a text or an image according to the style:
- Set a style to the check component with the
elm_object_style_set()
function. If you use the default style, you can skip this step.elm_object_style_set(check, "popup");
- Set a label to the check component with the
elm_object_text_set()
function:
/* Default style */ elm_object_text_set(check, "Check");
- Set a style to the check component with the
- Register the callback functions.
The following example shows how to define and register a callback for the
changed
signal:evas_object_smart_callback_add(check, "changed", changed_cb, data); void changed_cb(void *data, Evas_Object *obj, void *event_info) { dlog_print(DLOG_INFO, LOG_TAG, "The value has changed\n"); }
The following example shows a simple use case of the check component.
Example: Check use case
Evas_Object *win; Evas_Object *conf; Evas_Object *nf; Evas_Object *box; Evas_Object *check; /* Starting right after the basic EFL UI layout code [3] */ /* win - conformant - naviframe */ /* Add a box to pack a check */ box = elm_box_add(nf); evas_object_show(box); elm_naviframe_item_push(nf, "Check", NULL, NULL, box, NULL); check = elm_check_add(box); elm_object_style_set(check, "default"); evas_object_show(check); elm_box_pack_end(box, check); check = elm_check_add(box); elm_object_style_set(check, "on&off"); evas_object_show(check); elm_box_pack_end(box, check); |
Styles
The following table lists the available component styles.
Table: Check styles for rectangular devices
Style | Sample | Text part |
---|---|---|
default |
N/A | |
on&off |
N/A | |
popup |
default |
Table: Check styles for circular devices
Style | Sample | Text part |
---|---|---|
default |
N/A | |
on&off |
N/A | |
small popup |
default |
Callbacks
You can register callback functions connected to the following signals for a check object.
Table: Check callback signals
Signal | Description | event_info |
---|---|---|
changed |
The check component value changes. | NULL |