1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
9 Evas_Object *ck2 = data;
10 printf("ck %p to %i\n", obj, elm_check_state_get(obj));
11 elm_check_state_set(ck2, elm_check_state_get(obj));
12 printf("ck2 %p is now %i\n", ck2, elm_check_state_get(ck2));
16 test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
18 Evas_Object *win, *bg, *bx, *ic, *ck, *ck0;
21 win = elm_win_add(NULL, "checks", ELM_WIN_BASIC);
22 elm_win_title_set(win, "Checks");
23 elm_win_autodel_set(win, EINA_TRUE);
26 elm_win_resize_object_add(win, bg);
27 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
30 bx = elm_box_add(win);
31 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 elm_win_resize_object_add(win, bx);
35 ic = elm_icon_add(win);
36 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
37 elm_icon_file_set(ic, buf, NULL);
38 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
39 ck = elm_check_add(win);
40 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
42 elm_object_text_set(ck, "Icon sized to check");
43 elm_object_part_content_set(ck, "icon", ic);
44 elm_check_state_set(ck, 1);
45 elm_box_pack_end(bx, ck);
51 ic = elm_icon_add(win);
52 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
53 elm_icon_file_set(ic, buf, NULL);
54 elm_icon_scale_set(ic, 0, 0);
55 ck = elm_check_add(win);
56 elm_object_text_set(ck, "Icon no scale");
57 elm_object_part_content_set(ck, "icon", ic);
58 elm_box_pack_end(bx, ck);
62 evas_object_smart_callback_add(ck, "changed", changed_cb, ck0);
64 ck = elm_check_add(win);
65 elm_object_text_set(ck, "Label Only");
66 elm_box_pack_end(bx, ck);
69 ic = elm_icon_add(win);
70 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
71 elm_icon_file_set(ic, buf, NULL);
72 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
73 ck = elm_check_add(win);
74 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
75 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
76 elm_object_text_set(ck, "Disabled check");
77 elm_object_part_content_set(ck, "icon", ic);
78 elm_check_state_set(ck, 1);
79 elm_box_pack_end(bx, ck);
80 elm_object_disabled_set(ck, 1);
84 ic = elm_icon_add(win);
85 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
86 elm_icon_file_set(ic, buf, NULL);
87 elm_icon_scale_set(ic, 0, 0);
88 ck = elm_check_add(win);
89 elm_object_part_content_set(ck, "icon", ic);
90 elm_box_pack_end(bx, ck);
94 evas_object_show(win);