Basic text
Creating a label object, a widget to display text, with simple html-like markup:
//text_label Evas_Object *label_text; label_text = elm_label_add(win); elm_object_text_set(label_text,"My label"); evas_object_resize(label_text, 90, 30); evas_object_show(label_text);
Sliding text
If your text is too long, you can have it set to slide. The duration of the slide is to be set: it is set to five seconds in the following example. You can also have several styles:
//sliding text Evas_Object *label_slide; label_slide = elm_label_add(win); elm_object_text_set(label_slide, "Some long text for our label_slide, that is long but" "not too long."); elm_object_style_set(label_slide,"slide_bounce"); elm_label_slide_duration_set(label_slide, 3); elm_label_slide_mode_set(label_slide, ELM_LABEL_SLIDE_MODE_ALWAYS); elm_label_slide_go(label_slide); evas_object_resize(label_slide, 200, 15); evas_object_move(label_slide,0,40); evas_object_show(label_slide);
If needed, you can respond to end of a slide thanks to the slide,end event.
Marker text
A marker is a text that is centered and bold by default. As the default color is white, we will also set a color, blue in this example.
elm_object_style_set(label, "marker"); evas_object_color_set(label, 0, 0, 255, 255);
Styling the text
You can apply basic styles to the text. If, for instance, you would like to have a bold text, you can do as follows.
elm_object_text_set(label, "<b>This text is bold.</b>");
The whole code: label.c