Table Of Contents

Previous topic

innerwindow Module

Next topic

layout Module

label Module

../_images/label-preview.png

Widget description

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

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 emits the following signals, besides the ones sent from LayoutClass:

  • language,changed - The program’s language changed.
  • slide,end - The slide is end.

Enumerations

Wrap modes

efl.elementary.label.ELM_WRAP_NONE

No wrap

efl.elementary.label.ELM_WRAP_CHAR

Wrap between characters

efl.elementary.label.ELM_WRAP_WORD

Wrap in allowed wrapping points (as defined in the unicode standard)

efl.elementary.label.ELM_WRAP_MIXED

Word wrap, and if that fails, char wrap.

Slide modes

efl.elementary.label.ELM_LABEL_SLIDE_MODE_NONE

The label will never slide.

efl.elementary.label.ELM_LABEL_SLIDE_MODE_AUTO

The label slide if the content is bigger than it’s container.

efl.elementary.label.ELM_LABEL_SLIDE_MODE_ALWAYS

The label will always slide.

class efl.elementary.label.Label

Bases: efl.elementary.layout_class.LayoutClass

This is the class that actually implements the widget.

callback_language_changed_add()

The program’s language changed.

callback_slide_end_add()

A slide effect has ended.

ellipsis

The ellipsis behavior of the label

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(slide) or if the chosen wrap method was ELM_WRAP_WORD.

Type :bool
line_wrap

The wrapping behavior of the label

By default no wrapping is done.

Type :Wrap modes
slide

Deprecated since version 1.8: Use slide_mode instead.

slide_duration

The duration time in moving text from slide begin position to slide end position

Type :float
slide_get() → bool

Deprecated since version 1.8: Use slide_mode instead.

slide_go()

Start the slide effect.

New in version 1.8.

slide_mode

Change the slide mode of the label widget.

By default, slide mode is none.

Type :Slide modes

New in version 1.8.

slide_set(bool slide)

Deprecated since version 1.8: Use slide_mode instead.

wrap_width

Wrap width of the label

This is the maximum width size hint of the label.

Warning

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

Type :int