summaryrefslogtreecommitdiff
path: root/src/examples/elementary/radio_cxx_example_01.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/elementary/radio_cxx_example_01.cc')
-rw-r--r--src/examples/elementary/radio_cxx_example_01.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/examples/elementary/radio_cxx_example_01.cc b/src/examples/elementary/radio_cxx_example_01.cc
index c6d5146655..1b6c659e14 100644
--- a/src/examples/elementary/radio_cxx_example_01.cc
+++ b/src/examples/elementary/radio_cxx_example_01.cc
@@ -16,7 +16,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
16 win.text_set("Radio Example"); 16 win.text_set("Radio Example");
17 win.autohide_set(true); 17 win.autohide_set(true);
18 18
19 efl::ui::Box bx(instantiate, win); 19 efl::ui::Radio_Box bx(instantiate, win);
20 bx.orientation_set(EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); 20 bx.orientation_set(EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
21 win.content_set(bx); 21 win.content_set(bx);
22 22
@@ -30,15 +30,14 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
30 radio.content_set(ic); 30 radio.content_set(ic);
31 bx.pack_end(radio); 31 bx.pack_end(radio);
32 32
33 auto cb_val = std::bind([] (efl::ui::Radio &obj) 33 auto cb_val = std::bind([bx] (efl::ui::Radio &obj EINA_UNUSED)
34 { std::cout << "val is now: " << obj.group_value_get() << std::endl; }, 34 { std::cout << "val is now: " << bx.selected_value_get() << std::endl; },
35 std::placeholders::_1); 35 std::placeholders::_1);
36 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio, cb_val); 36 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio, cb_val);
37 37
38 efl::ui::Radio radio2(instantiate, win); 38 efl::ui::Radio radio2(instantiate, win);
39 radio2.text_set("Radio 2"); 39 radio2.text_set("Radio 2");
40 radio2.state_value_set(2); 40 radio2.state_value_set(2);
41 radio2.group_add(group);
42 41
43 efl::ui::Image ic2(instantiate, win); 42 efl::ui::Image ic2(instantiate, win);
44 ic2.icon_set("file"); 43 ic2.icon_set("file");
@@ -49,14 +48,12 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
49 efl::ui::Radio radio3(instantiate, win); 48 efl::ui::Radio radio3(instantiate, win);
50 radio3.text_set("Radio 3"); 49 radio3.text_set("Radio 3");
51 radio3.state_value_set(3); 50 radio3.state_value_set(3);
52 radio3.group_add(group);
53 bx.pack_end(radio3); 51 bx.pack_end(radio3);
54 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio3, cb_val); 52 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio3, cb_val);
55 53
56 efl::ui::Radio radio4(instantiate, win); 54 efl::ui::Radio radio4(instantiate, win);
57 radio4.text_set("Radio 4"); 55 radio4.text_set("Radio 4");
58 radio4.state_value_set(4); 56 radio4.state_value_set(4);
59 radio4.group_add(group);
60 bx.pack_end(radio4); 57 bx.pack_end(radio4);
61 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio4, cb_val); 58 efl::eolian::event_add(efl::ui::Nstate::changed_event, radio4, cb_val);
62} 59}