summaryrefslogtreecommitdiff
path: root/src/examples/elementary/bubble_example_01.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/examples/elementary/bubble_example_01.c
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary/bubble_example_01.c')
-rw-r--r--src/examples/elementary/bubble_example_01.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/examples/elementary/bubble_example_01.c b/src/examples/elementary/bubble_example_01.c
new file mode 100644
index 0000000000..ee49b35986
--- /dev/null
+++ b/src/examples/elementary/bubble_example_01.c
@@ -0,0 +1,63 @@
1//Compile with:
2//gcc -o bubble_example_01 bubble_example_01.c -g `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6void
7_bla(void *data, Evas_Object *obj, void *event_info)
8{
9 static unsigned char corner = 0;
10 ++corner;
11 if (corner > 3)
12 elm_bubble_pos_set(obj, ELM_BUBBLE_POS_TOP_LEFT);
13 else
14 elm_bubble_pos_set(obj, corner);
15
16}
17
18EAPI_MAIN int
19elm_main(int argc, char **argv)
20{
21 Evas_Object *win, *bubble, *label, *icon;
22
23 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
24
25 win = elm_win_util_standard_add("bubble", "Bubble");
26 elm_win_autodel_set(win, EINA_TRUE);
27
28 label = elm_label_add(win);
29 elm_object_text_set(label, "This is the CONTENT of our bubble");
30 evas_object_show(label);
31
32 icon = evas_object_rectangle_add(evas_object_evas_get(win));
33 evas_object_color_set(icon, 0, 0, 255, 255);
34 evas_object_show(icon);
35
36 bubble = elm_bubble_add(win);
37 elm_object_part_content_set(bubble, "icon", icon);
38 elm_object_part_text_set(bubble, "info", "INFO");
39 elm_object_text_set(bubble, "LABEL");
40 elm_object_content_set(bubble, label);
41 evas_object_resize(bubble, 300, 100);
42 evas_object_show(bubble);
43
44 evas_object_smart_callback_add(bubble, "clicked", _bla, NULL);
45
46 label = elm_label_add(win);
47 elm_object_text_set(label, "Bubble with no icon, info or label");
48 evas_object_show(label);
49
50 bubble = elm_bubble_add(win);
51 elm_object_content_set(bubble, label);
52 evas_object_resize(bubble, 200, 50);
53 evas_object_move(bubble, 0, 110);
54 evas_object_show(bubble);
55
56 evas_object_resize(win, 300, 200);
57 evas_object_show(win);
58
59 elm_run();
60
61 return 0;
62}
63ELM_MAIN()