Languages

Menu
Sites
Language
Radio butoon in Genlist

HI

I am working on tizen native app development in whcih i am using radio widget in an genlist.I want to know whetehr a radio button is selected or not.If not slected then want to mar it as selcted. I can get the radio as Evas_Object. But did not find any api which can set a [erticular radio button as selected.

 

  
 elm_radio_state_value_set(Evas_Object *obj, int value);

 elm_radio_state_value_get(const Evas_Object *obj);

 elm_radio_value_set(Evas_Object *obj, int value);

 elm_radio_value_get(const Evas_Object *obj);

I have tried to use above api, but did not succhedd to mark any radio button as selected.

Please help me to resiolve this problem.

 

Thanks,

Raghvendra

Edited by: Raghvendra Singh on 27 Apr, 2015

Responses

1 Replies
Alex Dem

Hi,
I don't know all your details and maybe you try to implement something else, but i could try to explain how select every radio button (in group of 3 buttons) I just simlified code (from UI Controls native example-> Radio)

Evas_Object *radio, *radio_group;
Evas_Object *layout;
...
radio = elm_radio_add(layout);
elm_object_part_content_set(layout, "radio1", radio);
elm_radio_state_value_set(radio, 10);

radio_group = radio;

radio = elm_radio_add(layout);
elm_radio_state_value_set(radio, 20);

elm_radio_group_add(radio, radio_group);
elm_object_part_content_set(layout, "radio2", radio);

radio = elm_radio_add(layout);

elm_radio_state_value_set(radio, 30);

elm_radio_group_add(radio, radio_group);
elm_object_part_content_set(layout, "radio3", radio);

After this using: elm_radio_value_set(radio_group , 10); elm_radio_value_set(radio_group , 20); or
elm_radio_value_set(radio_group , 30);  you could select appropriate value, but note that buttons are grouped and you could select only one value.
Hope this help but maybe I don't know all your details.
Alexey.