2 //gcc -g `pkg-config --cflags --libs elementary` notify_example_01.c -o notify_example_01
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 elm_win_resize_object_add(win, bg);
25 bx = elm_box_add(win);
26 elm_box_horizontal_set(bx, EINA_FALSE);
27 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
29 elm_win_resize_object_add(win, bx);
32 content = elm_label_add(win);
33 elm_object_text_set(content, "default");
34 evas_object_show(content);
36 notify = elm_notify_add(win);
37 elm_notify_repeat_events_set(notify, EINA_FALSE);
38 elm_notify_timeout_set(notify, 5);
39 elm_object_content_set(notify, content);
40 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41 evas_object_show(notify);
42 elm_box_pack_end(bx, notify);
43 evas_object_smart_callback_add(notify, "block,clicked", _hide, NULL);
45 content = elm_label_add(win);
46 elm_object_text_set(content, "bottom");
47 evas_object_show(content);
49 notify = elm_notify_add(win);
50 elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
51 elm_object_content_set(notify, content);
52 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
53 evas_object_show(notify);
54 elm_box_pack_end(bx, notify);
56 content = elm_label_add(win);
57 elm_object_text_set(content, "center");
58 evas_object_show(content);
60 notify = elm_notify_add(win);
61 elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_CENTER);
62 elm_object_content_set(notify, content);
63 evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
64 evas_object_show(notify);
65 elm_box_pack_end(bx, notify);
67 evas_object_resize(win, 100, 200);
68 evas_object_show(win);
77 _hide(void *data, Evas_Object *obj, void *event_info)
79 evas_object_hide(obj);