2.1.2. cairotft.widgets package

2.1.2.1. Submodules

2.1.2.3. cairotft.widgets.marquee module

Text Marquee widget.

class cairotft.widgets.marquee.Marquee(display_object, text, font_face, font_size, text_color, pos_x, pos_y, width, height, background_color=(1, 1, 1, 1), step=1, interval_time=0.05, transition=<bound method type.ease_in of <class 'cairotft.transitions.LinearTransition'>>, smooth=False)[source]

Bases: builtins.object

A text marquee widget.

_shrink_text(ctx)[source]

based on the font size, calculate the width of the text.

And eventually shrink the name if too long.

_smooth_draw_text()[source]

draw the text in the smooth text buffer.

This is not display, only drawed in the smooth buffer.

_smooth_init_buffer(ctx)[source]

Initialise the buffer used in smooth text.

change_background(background_color)[source]

Change the background color.

Parameters:background_color (tuple) – a tuple of 4 float representing the rgba value of the background color to repaint the icon.
change_color(color)[source]

Change the text color.

Parameters:color (tuple) – a tuple of 4 float representing the rgba value of the text color.
color_changed()[source]

Return True is either text_color or background_color has changed.

(since last paint)

show(ctx, no_loop=False)[source]

Show the text.

start(ctx)[source]

Start showing the marquee.

stop()[source]

stop showing the marquee.

2.1.2.4. Module contents

widgets.