2 //gcc -o notify_example_01 notify_example_01.c -g `pkg-config --cflags --libs elementary`
4 #include <Elementary.h>
6 # include "elementary_config.h"
9 static void _hide(void *data, Evas_Object *obj, void *event_info);
12 elm_main(int argc, char **argv)
14 Evas_Object *win, *bg, *bx, *notify, *content;
16 win = elm_win_add(NULL, "notify", ELM_WIN_BASIC);
17 elm_win_title_set(win, "Notify");
18 elm_win_autodel_set(win, EINA_TRUE);
19 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
22 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
23 elm_win_resize_object_add(win, bg);
26 bx = elm_box_add(win);
27 elm_box_horizontal_set(bx, EINA_FALSE);
28 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
30 elm_win_resize_object_add(win, bx);
33 content = elm_label_add(win);
34 elm_object_text_set(content, "default");
35 evas_object_show(content);
37 notify = elm_notify_add(win);
38 elm_notify_allow_events_set(notify, EINA_FALSE);
39 elm_notify_timeout_set(notify, 5);
40 elm_object_content_set(notify, content);
41 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
42 evas_object_show(notify);
43 elm_box_pack_end(bx, notify);
44 evas_object_smart_callback_add(notify, "block,clicked", _hide, NULL);
46 content = elm_label_add(win);
47 elm_object_text_set(content, "bottom");
48 evas_object_show(content);
50 notify = elm_notify_add(win);
51 elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
52 elm_object_content_set(notify, content);
53 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
54 evas_object_show(notify);
55 elm_box_pack_end(bx, notify);
57 content = elm_label_add(win);
58 elm_object_text_set(content, "center");
59 evas_object_show(content);
61 notify = elm_notify_add(win);
62 elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_CENTER);
63 elm_object_content_set(notify, content);
64 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
65 evas_object_show(notify);
66 elm_box_pack_end(bx, notify);
68 evas_object_resize(win, 100, 200);
69 evas_object_show(win);
78 _hide(void *data, Evas_Object *obj, void *event_info)
80 evas_object_hide(obj);