2 //gcc -o popup_example_01 popup_example_01.c -g `pkg-config --cflags --libs elementary`
4 #include <Elementary.h>
6 static void _block_clicked(void *data, Evas_Object *obj, void *event_info);
7 static void _timeout(void *data, Evas_Object *obj, void *event_info);
10 elm_main(int argc, char **argv)
12 Evas_Object *win, *bg, *popup, *content;
14 win = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
15 elm_win_title_set(win, "Popup");
16 elm_win_autodel_set(win, EINA_TRUE);
17 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
20 elm_bg_color_set(bg, 128, 128, 128);
21 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
22 elm_win_resize_object_add(win, bg);
25 content = elm_label_add(win);
26 elm_object_text_set(content, "<align=center>Content</align>");
28 popup = elm_popup_add(win);
29 elm_popup_timeout_set(popup, 3.0);
30 evas_object_smart_callback_add(popup, "timeout", _timeout, NULL);
32 //Setting popup content
33 elm_object_content_set(popup, content);
34 //Seting popup title-text
35 elm_object_part_text_set(popup, "title,text", "Title");
36 evas_object_show(popup);
37 evas_object_smart_callback_add(popup, "block,clicked", _block_clicked, NULL);
39 evas_object_show(win);
40 evas_object_resize(win, 480, 800);
50 _block_clicked(void *data, Evas_Object *obj,
53 evas_object_hide(obj);
57 _timeout(void *data, Evas_Object *obj, void *event_info)
59 evas_object_hide(obj);