efl.evas.Textblock Class

class efl.evas.Textblock(Canvas canvas, **kwargs)

Bases: efl.evas.Object

Parameters
  • canvas (Canvas) – Evas canvas for this object

  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance

clear

Clear the Textblock

line_number_geometry_get

Retrieve position and dimension information of a specific line.

This function is used to obtain the x, y, width and height of a the line located at index within this object.

Parameters

index – index of desired line

Return type

(int x, int y, int w, int h)

obstacle_add

Add obstacle evas object to be observed during layout of text. The textblock does the layout of the text according to the position of the obstacle.

Parameters

obstacle (Object) – An evas object to be used as an obstacle

Returns

True on success or False on failure

Return type

bool

New in version 1.15.

obstacle_del

Removes an object from observation during text layout.

Parameters

obstacle (Object) – An evas object to be removed as an obstacle

Returns

True on success or False on failure

Return type

bool

New in version 1.15.

obstacles_update

Triggers for relayout due to obstacles’ state change.

The obstacles alone don’t affect the layout, until this is called. Use this after doing changes (moving, positioning etc.) in the obstacles that you would like to be considered in the layout. For example: if you have just repositioned the obstacles to differrent coordinates relative to the textblock, you need to call this so it will consider this new state and will relayout the text.

New in version 1.15.

replace_char

Replacement character

Type

unicode

replace_char_get
replace_char_set
size_formatted

Get the formatted width and height. This calculates the actual size after restricting the textblock to the current size of the object. The main difference between this and size_native is that the “native” function does not wrapping into account it just calculates the real width of the object if it was placed on an infinite canvas, while this function gives the size after wrapping according to the size restrictions of the object.

For example for a textblock containing the text: “You shall not pass!” with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) has a native size of 19x1 and a formatted size of 5x4.

Type

(int w, int h)

See

size_native

size_formatted_get
size_native

Get the native width and height. This calculates the actual size without taking account the current size of the object. The main difference between this and size_formatted is that the “native” function does not take wrapping into account it just calculates the real width of the object if it was placed on an infinite canvas, while the “formatted” function gives the size after wrapping text according to the size restrictions of the object.

For example for a textblock containing the text: “You shall not pass!” with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) has a native size of 19x1 and a formatted size of 5x4.

Type

(int w, int h)

size_native_get
style

Style

Type

unicode

style_get
style_insets

Style insets

style_insets_get
style_set
text_markup

Markup text

Type

unicode

text_markup_get
text_markup_set