2 //gcc -o popup_example_01 popup_example_01.c -g `pkg-config --cflags --libs elementary`
4 #include <Elementary.h>
5 #define PACKAGE_DATA_DIR "../../data"
7 static void _block_clicked(void *data, Evas_Object *obj, void *event_info);
8 static void _timeout(void *data, Evas_Object *obj, void *event_info);
11 elm_main(int argc, char **argv)
13 Evas_Object *win, *bg, *popup, *content;
15 win = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
16 elm_win_title_set(win, "Popup");
17 elm_win_autodel_set(win, EINA_TRUE);
18 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
21 elm_bg_color_set(bg, 128, 128, 128);
22 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
23 elm_win_resize_object_add(win, bg);
26 content = elm_label_add(win);
27 elm_object_text_set(content, "<align=center>Content</align>");
29 popup = elm_popup_add(win);
30 elm_popup_timeout_set(popup, 3.0);
31 evas_object_smart_callback_add(popup, "timeout", _timeout, NULL);
33 //Setting popup content
34 elm_object_content_set(popup, content);
35 //Seting popup title-text
36 elm_object_part_text_set(popup, "title,text", "Title");
37 evas_object_show(popup);
38 evas_object_smart_callback_add(popup, "block,clicked", _block_clicked, NULL);
40 evas_object_show(win);
41 evas_object_resize(win, 480, 800);
51 _block_clicked(void *data, Evas_Object *obj,
54 evas_object_hide(obj);
58 _timeout(void *data, Evas_Object *obj, void *event_info)
60 evas_object_hide(obj);