2 //gcc -o notify_example_01 notify_example_01.c -g `pkg-config --cflags --libs elementary`
4 #include <Elementary.h>
6 static void _hide(void *data, Evas_Object *obj, void *event_info);
9 elm_main(int argc, char **argv)
11 Evas_Object *win, *bx, *notify, *content;
13 win = elm_win_util_standard_add("notify", "Notify");
14 elm_win_autodel_set(win, EINA_TRUE);
15 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
17 bx = elm_box_add(win);
18 elm_box_horizontal_set(bx, EINA_FALSE);
19 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
20 elm_win_resize_object_add(win, bx);
23 content = elm_label_add(win);
24 elm_object_text_set(content, "default");
25 evas_object_show(content);
27 notify = elm_notify_add(win);
28 elm_notify_allow_events_set(notify, EINA_FALSE);
29 elm_notify_timeout_set(notify, 5);
30 elm_object_content_set(notify, content);
31 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 evas_object_show(notify);
33 elm_box_pack_end(bx, notify);
34 evas_object_smart_callback_add(notify, "block,clicked", _hide, NULL);
36 content = elm_label_add(win);
37 elm_object_text_set(content, "bottom");
38 evas_object_show(content);
40 notify = elm_notify_add(win);
41 elm_notify_align_set(notify, 0.5, 1.0);
42 elm_object_content_set(notify, content);
43 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
44 evas_object_show(notify);
45 elm_box_pack_end(bx, notify);
47 content = elm_label_add(win);
48 elm_object_text_set(content, "center");
49 evas_object_show(content);
51 notify = elm_notify_add(win);
52 elm_notify_align_set(notify, 0.5, 0.5);
53 elm_object_content_set(notify, content);
54 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
55 evas_object_show(notify);
56 elm_box_pack_end(bx, notify);
58 evas_object_resize(win, 100, 200);
59 evas_object_show(win);
68 _hide(void *data, Evas_Object *obj, void *event_info)
70 evas_object_hide(obj);