aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/elementary/src/examples/label_example_01.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/elementary/src/examples/label_example_01.c')
-rw-r--r--libraries/elementary/src/examples/label_example_01.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/libraries/elementary/src/examples/label_example_01.c b/libraries/elementary/src/examples/label_example_01.c
new file mode 100644
index 0000000..343f40e
--- /dev/null
+++ b/libraries/elementary/src/examples/label_example_01.c
@@ -0,0 +1,80 @@
1//Compile with:
2//gcc -o label_example_01 label_example_01.c -g `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6EAPI_MAIN int
7elm_main(int argc, char **argv)
8{
9 Evas_Object *win, *bg, *label, *label2, *label3, *label4, *label5, *label6;
10
11 win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
12 elm_win_title_set(win, "Label");
13 elm_win_autodel_set(win, EINA_TRUE);
14 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
15
16 bg = elm_bg_add(win);
17 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
18 elm_win_resize_object_add(win, bg);
19 evas_object_show(bg);
20
21 label = elm_label_add(win);
22 elm_object_text_set(label, "Some long text for our label, that is long but "
23 "not too long.");
24 elm_label_slide_duration_set(label, 3);
25 elm_label_slide_set(label, EINA_TRUE);
26 elm_object_style_set(label, "slide_bounce");
27 evas_object_resize(label, 200, 15);
28 evas_object_show(label);
29
30 label2 = elm_label_add(win);
31 elm_object_text_set(label2, "This is the text for our second label, which is"
32 " much longer than the previous one, maybe even "
33 "too long, but maybe not.");
34 elm_label_ellipsis_set(label2, EINA_TRUE);
35 evas_object_resize(label2, 200, 15);
36 evas_object_move(label2, 0, 15);
37 evas_object_show(label2);
38
39 label3 = elm_label_add(win);
40 elm_object_text_set(label3, "Some more long text much as before, long but "
41 "not too long.");
42 elm_label_line_wrap_set(label3, ELM_WRAP_CHAR);
43 elm_label_ellipsis_set(label3, EINA_TRUE);
44 evas_object_resize(label3, 200, 15);
45 evas_object_move(label3, 0, 30);
46 evas_object_show(label3);
47
48 label4 = elm_label_add(win);
49 elm_object_text_set(label4, "And for this label we choose a different text, "
50 "for no reason other than that we can.");
51 elm_label_line_wrap_set(label4, ELM_WRAP_CHAR);
52 evas_object_resize(label4, 200, 30);
53 evas_object_move(label4, 0, 45);
54 evas_object_show(label4);
55
56 label5 = elm_label_add(win);
57 elm_object_text_set(label5, "And for this label we choose a different text, "
58 "for no reason other than that we can.");
59 elm_label_line_wrap_set(label5, ELM_WRAP_WORD);
60 evas_object_resize(label5, 200, 30);
61 evas_object_move(label5, 0, 75);
62 evas_object_show(label5);
63
64 label6 = elm_label_add(win);
65 elm_object_text_set(label6, "Short text");
66 elm_object_style_set(label6, "marker");
67 evas_object_color_set(label6, 255, 0, 0, 255);
68 evas_object_resize(label6, 200, 15);
69 evas_object_move(label6, 0, 105);
70 evas_object_show(label6);
71
72 evas_object_resize(win, 200, 125);
73 evas_object_show(win);
74
75 elm_run();
76 elm_shutdown();
77
78 return 0;
79}
80ELM_MAIN()