1 #include <Elementary.hh>
4 elm_main (int argc, char *argv[])
6 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN);
10 ::elm::win_standard win;
11 win.title_set("Radio");
12 win.autohide_set(true);
14 ::elm::box bx(efl::eo::parent = win);
15 bx.horizontal_set(true);
16 bx.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
17 win.resize_object_add(bx);
20 ::elm::radio radio(efl::eo::parent = win);
21 ::elm::radio group(efl::eo::parent = win);
23 radio.text_set("elm.text", "Radio 1");
24 radio.state_value_set(1);
25 radio.value_pointer_set(&val);
26 ::elm::icon ic(efl::eo::parent = win);
27 ic.standard_set("home");
28 radio.content_set("icon", ic);
30 radio.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31 radio.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
32 radio.visible_set(true);
34 auto cb_val = std::bind([] () { std::cout << "val is now: " << val << std::endl; });
36 radio.callback_changed_add(cb_val);
38 ::elm::radio radio2(efl::eo::parent = win);
39 radio2.text_set("elm.text", "Radio 2");
40 radio2.state_value_set(2);
41 radio2.value_pointer_set(&val);
42 radio2.group_add(group);
43 ::elm::icon ic2(efl::eo::parent = win);
44 ic2.standard_set("file");
45 radio2.content_set("icon", ic2);
47 radio2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
48 radio2.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
49 radio2.visible_set(true);
50 radio2.callback_changed_add(cb_val);
52 ::elm::radio radio3(efl::eo::parent = win);
53 radio3.text_set("elm.text", "Radio 3");
54 radio3.state_value_set(3);
55 radio3.value_pointer_set(&val);
56 radio3.group_add(group);
58 radio3.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
59 radio3.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
60 radio3.visible_set(true);
61 radio3.callback_changed_add(cb_val);
63 ::elm::radio radio4(efl::eo::parent = win);
64 radio4.text_set("elm.text", "Radio 4");
65 radio4.state_value_set(4);
66 radio4.value_pointer_set(&val);
67 radio4.group_add(group);
69 radio4.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
70 radio4.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL);
71 radio4.visible_set(true);
72 radio4.callback_changed_add(cb_val);
74 win.visible_set(true);