Label

Widget to display text, with simple html-like markup. More...

Functions

Evas_Object * elm_label_add (Evas_Object *parent)
 Add a new label to the parent.
void elm_label_line_wrap_set (Evas_Object *obj, Elm_Wrap_Type wrap)
 Set the wrapping behavior of the label.
Elm_Wrap_Type elm_label_line_wrap_get (const Evas_Object *obj)
 Get the wrapping behavior of the label.
void elm_label_wrap_width_set (Evas_Object *obj, Evas_Coord w)
 Set wrap width of the label.
Evas_Coord elm_label_wrap_width_get (const Evas_Object *obj)
 Get wrap width of the label.
void elm_label_ellipsis_set (Evas_Object *obj, Eina_Bool ellipsis)
 Set the ellipsis behavior of the label.
Eina_Bool elm_label_ellipsis_get (const Evas_Object *obj)
 Get the ellipsis behavior of the label.
void elm_label_slide_set (Evas_Object *obj, Eina_Bool slide)
 Set sliding effect of label widget.
Eina_Bool elm_label_slide_get (const Evas_Object *obj)
 Get whether sliding effect is shown or not.
void elm_label_slide_duration_set (Evas_Object *obj, double duration)
 Set the slide duration (speed) of the label.
double elm_label_slide_duration_get (const Evas_Object *obj)
 Get the slide duration(speed) of the label.

Detailed Description

Widget to display text, with simple html-like markup.

label_inheritance_tree.png
preview-00.png

The Label widget doesn't allow text to overflow its boundaries, if the text doesn't fit the geometry of the label it will be ellipsized or be cut. Elementary provides several styles for this widget:

  • default - No animation
  • marker - Centers the text in the label and makes it bold by default
  • slide_long - The entire text appears from the right of the screen and slides until it disappears in the left of the screen(reappearing on the right again).
  • slide_short - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the position is reset.
  • slide_bounce - The text appears in the left of the label and slides to the right to show the overflow. When all of the text has been shown the animation reverses, moving the text to the left.

Custom themes can of course invent new markup tags and style them any way they like.

This widget inherits from the Layout one, so that all the functions acting on it also work for label objects.

This widget emits the following signals, besides the ones sent from Layout:

  • "language,changed": The program's language changed.

See Label example for a demonstration of how to use a label widget.


Function Documentation

Evas_Object* elm_label_add ( Evas_Object *  parent)

Add a new label to the parent.

Parameters:
parentThe parent object
Returns:
The new object or NULL if it cannot be created
Eina_Bool elm_label_ellipsis_get ( const Evas_Object *  obj)

Get the ellipsis behavior of the label.

Parameters:
objThe label object
Returns:
If true, an ellipsis will be shown at the end of the label area.
See also:
elm_label_ellipsis_set()
void elm_label_ellipsis_set ( Evas_Object *  obj,
Eina_Bool  ellipsis 
)

Set the ellipsis behavior of the label.

Parameters:
objThe label object
ellipsisTo ellipsis text or not

If set to true and the text doesn't fit in the label an ellipsis("...") will be shown at the end of the widget.

Warning:
This doesn't work with slide(elm_label_slide_set()) or if the chosen wrap method was ELM_WRAP_WORD.

References elm_layout_sizing_eval(), and ELM_WIDGET_DATA.

Elm_Wrap_Type elm_label_line_wrap_get ( const Evas_Object *  obj)

Get the wrapping behavior of the label.

Parameters:
objThe label object
Returns:
Wrap type
See also:
elm_label_line_wrap_set()
void elm_label_line_wrap_set ( Evas_Object *  obj,
Elm_Wrap_Type  wrap 
)

Set the wrapping behavior of the label.

Parameters:
objThe label object
wrapTo wrap text or not

By default no wrapping is done. Possible values for wrap are:

  • ELM_WRAP_NONE - No wrapping
  • ELM_WRAP_CHAR - wrap between characters
  • ELM_WRAP_WORD - wrap between words
  • ELM_WRAP_MIXED - Word wrap, and if that fails, char wrap

References elm_layout_sizing_eval(), ELM_WIDGET_DATA, ELM_WRAP_CHAR, ELM_WRAP_MIXED, and ELM_WRAP_WORD.

Referenced by elm_popup_content_text_wrap_type_set().

double elm_label_slide_duration_get ( const Evas_Object *  obj)

Get the slide duration(speed) of the label.

Parameters:
objThe label object
Returns:
The duration time in moving text from slide begin position to slide end position
See also:
elm_label_slide_duration_set()
void elm_label_slide_duration_set ( Evas_Object *  obj,
double  duration 
)

Set the slide duration (speed) of the label.

Parameters:
objThe label object
durationThe duration in seconds in moving text from slide begin position to slide end position

References ELM_WIDGET_DATA.

Eina_Bool elm_label_slide_get ( const Evas_Object *  obj)

Get whether sliding effect is shown or not.

Parameters:
objThe label object
Returns:
If true, sliding effect is shown.
See also:
elm_label_slide_set()
void elm_label_slide_set ( Evas_Object *  obj,
Eina_Bool  slide 
)

Set sliding effect of label widget.

Parameters:
objThe label object
slideIf true, sliding effect will be shown

If set to true, the text of the label will slide/scroll through the length of label.

Warning:
This only works with the themes "slide_short", "slide_long" and "slide_bounce".

References elm_layout_sizing_eval().

Evas_Coord elm_label_wrap_width_get ( const Evas_Object *  obj)

Get wrap width of the label.

Parameters:
objThe label object
Returns:
The wrap width in pixels at a minimum where words need to wrap
See also:
elm_label_wrap_width_set()
void elm_label_wrap_width_set ( Evas_Object *  obj,
Evas_Coord  w 
)

Set wrap width of the label.

Parameters:
objThe label object
wThe wrap width in pixels at a minimum where words need to wrap

This function sets the maximum width size hint of the label.

Warning:
This is only relevant if the label is inside a container.

References elm_layout_sizing_eval(), and ELM_WIDGET_DATA.