1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
10 changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
12 Evas_Object *ck2 = data;
13 printf("ck %p to %i\n", obj, elm_check_state_get(obj));
14 elm_check_state_set(ck2, elm_check_state_get(obj));
15 printf("ck2 %p is now %i\n", ck2, elm_check_state_get(ck2));
19 state_changed_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
21 printf("State Pointer Value: %d\n", eb);
25 test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
27 Evas_Object *win, *bg, *bx, *ic, *ck, *ck0;
30 win = elm_win_add(NULL, "checks", ELM_WIN_BASIC);
31 elm_win_title_set(win, "Checks");
32 elm_win_autodel_set(win, EINA_TRUE);
35 elm_win_resize_object_add(win, bg);
36 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
39 bx = elm_box_add(win);
40 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41 elm_win_resize_object_add(win, bx);
44 ic = elm_icon_add(win);
45 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
46 elm_icon_file_set(ic, buf, NULL);
47 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
48 ck = elm_check_add(win);
49 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
51 elm_object_text_set(ck, "Icon sized to check");
52 elm_object_part_content_set(ck, "icon", ic);
53 elm_check_state_set(ck, 1);
54 elm_box_pack_end(bx, ck);
60 ic = elm_icon_add(win);
61 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
62 elm_icon_file_set(ic, buf, NULL);
63 elm_icon_scale_set(ic, 0, 0);
64 ck = elm_check_add(win);
65 elm_object_text_set(ck, "Icon no scale");
66 elm_object_part_content_set(ck, "icon", ic);
67 elm_box_pack_end(bx, ck);
71 evas_object_smart_callback_add(ck, "changed", changed_cb, ck0);
73 ck = elm_check_add(win);
74 elm_object_text_set(ck, "Label Only");
75 elm_box_pack_end(bx, ck);
78 ck = elm_check_add(win);
79 elm_object_text_set(ck, "Using State Pointer");
80 elm_check_state_pointer_set(ck, &eb);
81 elm_box_pack_end(bx, ck);
84 ck = elm_check_add(win);
85 elm_object_text_set(ck, "Check State Pointer Value");
86 elm_box_pack_end(bx, ck);
88 evas_object_smart_callback_add(ck, "changed", state_changed_cb, NULL);
90 ic = elm_icon_add(win);
91 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
92 elm_icon_file_set(ic, buf, NULL);
93 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
94 ck = elm_check_add(win);
95 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
96 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
97 elm_object_text_set(ck, "Disabled check");
98 elm_object_part_content_set(ck, "icon", ic);
99 elm_check_state_set(ck, 1);
100 elm_box_pack_end(bx, ck);
101 elm_object_disabled_set(ck, 1);
102 evas_object_show(ck);
103 evas_object_show(ic);
105 ic = elm_icon_add(win);
106 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
107 elm_icon_file_set(ic, buf, NULL);
108 elm_icon_scale_set(ic, 0, 0);
109 ck = elm_check_add(win);
110 elm_object_part_content_set(ck, "icon", ic);
111 elm_box_pack_end(bx, ck);
112 evas_object_show(ck);
113 evas_object_show(ic);
115 evas_object_show(win);