summaryrefslogtreecommitdiff
path: root/src/examples/elementary/label_example_02.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/label_example_02.c
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/examples/elementary/label_example_02.c')
-rw-r--r--src/examples/elementary/label_example_02.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/examples/elementary/label_example_02.c b/src/examples/elementary/label_example_02.c
new file mode 100644
index 0000000000..0c3cfb2213
--- /dev/null
+++ b/src/examples/elementary/label_example_02.c
@@ -0,0 +1,76 @@
1//Compile with:
2//gcc -g label_example_02.c -o label_example_02 `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6static void
7_slide_end_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
8{
9 Evas_Object *label2 = data;
10
11 printf("\"slide,end\" signal is emitted!\n");
12
13 elm_label_slide_mode_set(obj, ELM_LABEL_SLIDE_MODE_NONE);
14 elm_label_slide_mode_set(label2, ELM_LABEL_SLIDE_MODE_ALWAYS);
15 elm_label_slide_go(obj);
16 elm_label_slide_go(label2);
17}
18
19EAPI_MAIN int
20elm_main(int argc, char** argv)
21{
22 Evas_Object *win, *box, *label1, *label2, *label3;
23
24 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
25
26 // Win
27 win = elm_win_util_standard_add("label", "Label Slide");
28 elm_win_autodel_set(win, EINA_TRUE);
29 evas_object_resize(win, 200, 100);
30 evas_object_show(win);
31
32 // Box
33 box = elm_box_add(win);
34 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 evas_object_show(box);
36 elm_win_resize_object_add(win, box);
37
38 // Label1
39 label1 = elm_label_add(box);
40 elm_object_style_set(label1, "slide_long");
41 elm_object_text_set(label1, "This first label starts sliding automatically, and stops after one sliding.");
42 elm_label_wrap_width_set(label1, 200);
43 elm_label_slide_duration_set(label1, 4.0);
44 evas_object_show(label1);
45 elm_box_pack_end(box, label1);
46
47 // Label2
48 label2 = elm_label_add(box);
49 elm_object_style_set(label2, "slide_short");
50 elm_object_text_set(label2, "The second label starts sliding after the first label stops its sliding.");
51 elm_label_wrap_width_set(label2, 200);
52 elm_label_slide_duration_set(label2, 3.0);
53 evas_object_show(label2);
54 elm_box_pack_end(box, label2);
55
56 // Label3
57 label3 = elm_label_add(box);
58 elm_object_style_set(label3, "slide_bounce");
59 elm_object_text_set(label3, "The third label starts sliding after the second label stops its sliding.");
60 elm_label_wrap_width_set(label3, 200);
61 elm_label_slide_duration_set(label3, 2.0);
62 evas_object_show(label3);
63 elm_box_pack_end(box, label3);
64
65 evas_object_smart_callback_add(label1, "slide,end", _slide_end_cb, label2);
66 evas_object_smart_callback_add(label2, "slide,end", _slide_end_cb, label3);
67 evas_object_smart_callback_add(label3, "slide,end", _slide_end_cb, label1);
68
69 elm_label_slide_mode_set(label1, ELM_LABEL_SLIDE_MODE_ALWAYS);
70 elm_label_slide_go(label1);
71
72 elm_run();
73
74 return 0;
75}
76ELM_MAIN()