2 //gcc -g `pkg-config --cflags --libs elementary` -DPACKAGE_DATA_DIR="\"<directory>\"" bubble_example_01.c -o bubble_example_01
4 #include <Elementary.h>
6 # include "elementary_config.h"
9 static const char *corners[] = {"top_left", "top_right",
10 "bottom_right", "bottom_left"};
13 _bla(void *data, Evas_Object *obj, void *event_info)
15 static unsigned char corner = 0;
16 elm_bubble_corner_set(obj, corners[++corner > 3 ? corner = 0 : corner]);
20 elm_main(int argc, char **argv)
22 Evas_Object *win, *bg, *bubble, *label, *icon;
25 win = elm_win_add(NULL, "bubble", ELM_WIN_BASIC);
26 elm_win_title_set(win, "Bubble");
27 elm_win_autodel_set(win, EINA_TRUE);
28 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
31 elm_win_resize_object_add(win, bg);
34 label = elm_label_add(win);
35 elm_object_text_set(label, "This is the CONTENT of our bubble");
36 evas_object_show(label);
38 icon = evas_object_rectangle_add(evas_object_evas_get(win));
39 evas_object_color_set(icon, 0, 0, 255, 255);
40 evas_object_show(icon);
42 bubble = elm_bubble_add(win);
43 elm_object_part_content_set(bubble, "icon", icon);
44 elm_object_part_text_set(bubble, "info", "INFO");
45 elm_object_text_set(bubble, "LABEL");
46 elm_object_content_set(bubble, label);
47 evas_object_resize(bubble, 300, 100);
48 evas_object_show(bubble);
50 evas_object_smart_callback_add(bubble, "clicked", _bla, NULL);
52 label = elm_label_add(win);
53 elm_object_text_set(label, "Bubble with no icon, info or label");
54 evas_object_show(label);
56 bubble = elm_bubble_add(win);
57 elm_object_content_set(bubble, label);
58 evas_object_resize(bubble, 200, 50);
59 evas_object_move(bubble, 0, 110);
60 evas_object_show(bubble);
62 evas_object_resize(win, 300, 200);
63 evas_object_show(win);
67 evas_object_del(icon);