Label

../_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.

Available styles

default
The default style
default/left
Left aligned label (since 1.18)
default/right
Right aligned label (since 1.18)
marker
Centers the text in the label and makes it bold by default
marker/left
Like marker but left aligned (since 1.18)
marker/right
Like marker but right aligned (since 1.18)
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.

Emitted signals

  • slide,end - The slide is end.

Enumerations

Slide modes

efl.elementary.ELM_LABEL_SLIDE_MODE_NONE

The label will never slide.

efl.elementary.ELM_LABEL_SLIDE_MODE_AUTO

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

efl.elementary.ELM_LABEL_SLIDE_MODE_ALWAYS

The label will always slide.

Inheritance diagram

Inheritance diagram of Label

class efl.elementary.Label(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.LayoutClass

Parameters:
  • parent (efl.evas.Object) – The parent object
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
callback_slide_end_add(func, *args, **kwargs)

A slide effect has ended.

callback_slide_end_del(func)
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
ellipsis_get()
ellipsis_set(ellipsis)
line_wrap

The wrapping behavior of the label

By default no wrapping is done.

Type:Wrap mode
line_wrap_get()
line_wrap_set(wrap)
slide_duration

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

Type:float

Note

If you set the speed of the slide using slide_speed you cannot get the correct duration using this function until the label is actually rendered and resized.

slide_duration_get()
slide_duration_set(duration)
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_mode_get()
slide_mode_set(mode)
slide_speed

The speed of the slide animation in px per seconds

Type:float

Note

If you set the duration of the slide using slide_duration you cannot get the correct speed using this function until the label is actually rendered and resized.

New in version 1.9.

slide_speed_get()
slide_speed_set(speed)
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
wrap_width_get()
wrap_width_set(w)