1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *win, *bg, *bx, *ic, *rd, *rdg;
12 win = elm_win_add(NULL, "radio", ELM_WIN_BASIC);
13 elm_win_title_set(win, "Radios");
14 elm_win_autodel_set(win, 1);
17 elm_win_resize_object_add(win, bg);
18 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
21 bx = elm_box_add(win);
22 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
23 elm_win_resize_object_add(win, bx);
26 ic = elm_icon_add(win);
27 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
28 elm_icon_file_set(ic, buf, NULL);
29 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
31 rd = elm_radio_add(win);
32 elm_radio_state_value_set(rd, 0);
33 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
34 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, 0.5);
35 elm_radio_label_set(rd, "Icon sized to radio");
36 elm_radio_icon_set(rd, ic);
37 elm_box_pack_end(bx, rd);
42 ic = elm_icon_add(win);
43 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
44 elm_icon_file_set(ic, buf, NULL);
45 elm_icon_scale_set(ic, 0, 0);
47 rd = elm_radio_add(win);
48 elm_radio_state_value_set(rd, 1);
49 elm_radio_group_add(rd, rdg);
50 elm_radio_label_set(rd, "Icon no scale");
51 elm_radio_icon_set(rd, ic);
52 elm_box_pack_end(bx, rd);
56 rd = elm_radio_add(win);
57 elm_radio_state_value_set(rd, 2);
58 elm_radio_group_add(rd, rdg);
59 elm_radio_label_set(rd, "Label Only");
60 elm_box_pack_end(bx, rd);
63 rd = elm_radio_add(win);
64 elm_radio_state_value_set(rd, 3);
65 elm_radio_group_add(rd, rdg);
66 elm_radio_label_set(rd, "Disabled");
67 elm_object_disabled_set(rd, 1);
68 elm_box_pack_end(bx, rd);
71 ic = elm_icon_add(win);
72 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
73 elm_icon_file_set(ic, buf, NULL);
74 elm_icon_scale_set(ic, 0, 0);
76 rd = elm_radio_add(win);
77 elm_radio_state_value_set(rd, 4);
78 elm_radio_group_add(rd, rdg);
79 elm_radio_icon_set(rd, ic);
80 elm_box_pack_end(bx, rd);
84 ic = elm_icon_add(win);
85 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
86 elm_icon_file_set(ic, buf, NULL);
87 elm_icon_scale_set(ic, 0, 0);
89 rd = elm_radio_add(win);
90 elm_radio_state_value_set(rd, 5);
91 elm_radio_group_add(rd, rdg);
92 elm_radio_icon_set(rd, ic);
93 elm_object_disabled_set(rd, 1);
94 elm_box_pack_end(bx, rd);
98 elm_radio_value_set(rdg, 2);
100 evas_object_show(win);