2 //gcc -g `pkg-config --cflags --libs elementary` label_example_01.c -o label_example_01
4 #include <Elementary.h>
6 # include "elementary_config.h"
10 elm_main(int argc, char **argv)
12 Evas_Object *win, *bg, *label, *label2, *label3, *label4, *label5, *label6;
14 win = elm_win_add(NULL, "label", ELM_WIN_BASIC);
15 elm_win_title_set(win, "Label");
16 elm_win_autodel_set(win, EINA_TRUE);
17 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
20 elm_win_resize_object_add(win, bg);
23 label = elm_label_add(win);
24 elm_object_text_set(label, "Some long text for our label, that is long but "
26 elm_label_slide_duration_set(label, 3);
27 elm_label_slide_set(label, EINA_TRUE);
28 elm_object_style_set(label, "slide_bounce");
29 evas_object_resize(label, 200, 15);
30 evas_object_show(label);
32 label2 = elm_label_add(win);
33 elm_object_text_set(label2, "This is the text for our second label, which is"
34 " much longer than the previous one, maybe even "
35 "too long, but maybe not.");
36 elm_label_ellipsis_set(label2, EINA_TRUE);
37 evas_object_resize(label2, 200, 15);
38 evas_object_move(label2, 0, 15);
39 evas_object_show(label2);
41 label3 = elm_label_add(win);
42 elm_object_text_set(label3, "Some more long text much as before, long but "
44 elm_label_line_wrap_set(label3, ELM_WRAP_CHAR);
45 elm_label_ellipsis_set(label3, EINA_TRUE);
46 evas_object_resize(label3, 200, 15);
47 evas_object_move(label3, 0, 30);
48 evas_object_show(label3);
50 label4 = elm_label_add(win);
51 elm_object_text_set(label4, "And for this label we choose a different text, "
52 "for no reason other than that we can.");
53 elm_label_line_wrap_set(label4, ELM_WRAP_CHAR);
54 evas_object_resize(label4, 200, 30);
55 evas_object_move(label4, 0, 45);
56 evas_object_show(label4);
58 label5 = elm_label_add(win);
59 elm_object_text_set(label5, "And for this label we choose a different text, "
60 "for no reason other than that we can.");
61 elm_label_line_wrap_set(label5, ELM_WRAP_WORD);
62 evas_object_resize(label5, 200, 30);
63 evas_object_move(label5, 0, 75);
64 evas_object_show(label5);
66 label6 = elm_label_add(win);
67 elm_object_text_set(label6, "Short text");
68 elm_object_style_set(label6, "marker");
69 evas_object_color_set(label6, 255, 0, 0, 255);
70 evas_object_resize(label6, 200, 15);
71 evas_object_move(label6, 0, 105);
72 evas_object_show(label6);
74 evas_object_resize(win, 200, 125);
75 evas_object_show(win);