summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-09-19 02:49:30 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-09-19 02:49:30 +0900
commit7cbcad2898bad952879b4160f1c48059668f0d0d (patch)
tree36a4fc4f32a88bc0e7e507a99ed581975e00039e
parent77a495ba9487b57cadbb856b271fbdf9a0cc9689 (diff)
test_radio: Added a changed callback to a radio group.
-rw-r--r--src/bin/test_radio.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/bin/test_radio.c b/src/bin/test_radio.c
index 28187ef38..2c1a8b6cc 100644
--- a/src/bin/test_radio.c
+++ b/src/bin/test_radio.c
@@ -10,6 +10,13 @@ _rd_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
10 printf("radio value : %d\n", elm_radio_value_get(obj)); 10 printf("radio value : %d\n", elm_radio_value_get(obj));
11} 11}
12 12
13static void
14_rdg_changed_cb(void *data EINA_UNUSED, Evas_Object *obj,
15 void *event_info EINA_UNUSED)
16{
17 printf("radio group value : %d\n", elm_radio_value_get(obj));
18}
19
13void 20void
14test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 21test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
15 void *event_info EINA_UNUSED) 22 void *event_info EINA_UNUSED)
@@ -40,7 +47,10 @@ test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
40 elm_box_pack_end(bx, rd); 47 elm_box_pack_end(bx, rd);
41 evas_object_show(rd); 48 evas_object_show(rd);
42 evas_object_smart_callback_add(rd, "changed", _rd_changed_cb, NULL); 49 evas_object_smart_callback_add(rd, "changed", _rd_changed_cb, NULL);
50
51 // rdg radio group
43 rdg = rd; 52 rdg = rd;
53 evas_object_smart_callback_add(rdg, "changed", _rdg_changed_cb, NULL);
44 54
45 ic = elm_icon_add(win); 55 ic = elm_icon_add(win);
46 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); 56 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
@@ -58,7 +68,7 @@ test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
58 68
59 rd = elm_radio_add(win); 69 rd = elm_radio_add(win);
60 elm_radio_state_value_set(rd, 2); 70 elm_radio_state_value_set(rd, 2);
61 elm_radio_group_add(rd, rdg); 71 elm_radio_group_add(rd, rdg); // add a radio button rd to a radio group rdg.
62 elm_object_text_set(rd, "Label Only"); 72 elm_object_text_set(rd, "Label Only");
63 elm_box_pack_end(bx, rd); 73 elm_box_pack_end(bx, rd);
64 evas_object_show(rd); 74 evas_object_show(rd);
@@ -66,7 +76,7 @@ test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
66 76
67 rd = elm_radio_add(win); 77 rd = elm_radio_add(win);
68 elm_radio_state_value_set(rd, 3); 78 elm_radio_state_value_set(rd, 3);
69 elm_radio_group_add(rd, rdg); 79 elm_radio_group_add(rd, rdg); // add a radio button rd to a radio group rdg.
70 elm_object_text_set(rd, "Disabled"); 80 elm_object_text_set(rd, "Disabled");
71 elm_object_disabled_set(rd, EINA_TRUE); 81 elm_object_disabled_set(rd, EINA_TRUE);
72 elm_box_pack_end(bx, rd); 82 elm_box_pack_end(bx, rd);
@@ -80,7 +90,7 @@ test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
80 90
81 rd = elm_radio_add(win); 91 rd = elm_radio_add(win);
82 elm_radio_state_value_set(rd, 4); 92 elm_radio_state_value_set(rd, 4);
83 elm_radio_group_add(rd, rdg); 93 elm_radio_group_add(rd, rdg); // add a radio button rd to a radio group rdg.
84 elm_object_part_content_set(rd, "icon", ic); 94 elm_object_part_content_set(rd, "icon", ic);
85 elm_box_pack_end(bx, rd); 95 elm_box_pack_end(bx, rd);
86 evas_object_show(rd); 96 evas_object_show(rd);
@@ -93,7 +103,7 @@ test_radio(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
93 103
94 rd = elm_radio_add(win); 104 rd = elm_radio_add(win);
95 elm_radio_state_value_set(rd, 5); 105 elm_radio_state_value_set(rd, 5);
96 elm_radio_group_add(rd, rdg); 106 elm_radio_group_add(rd, rdg); // add a radio button rd to a radio group rdg.
97 elm_object_part_content_set(rd, "icon", ic); 107 elm_object_part_content_set(rd, "icon", ic);
98 elm_object_disabled_set(rd, EINA_TRUE); 108 elm_object_disabled_set(rd, EINA_TRUE);
99 elm_box_pack_end(bx, rd); 109 elm_box_pack_end(bx, rd);