Champlain.Label

g Atk.ImplementorIface Atk.ImplementorIface Clutter.Actor Clutter.Actor Atk.ImplementorIface->Clutter.Actor Champlain.Label Champlain.Label Champlain.Location Champlain.Location Champlain.Marker Champlain.Marker Champlain.Location->Champlain.Marker Champlain.Marker->Champlain.Label Clutter.Actor->Champlain.Marker Clutter.Animatable Clutter.Animatable Clutter.Animatable->Clutter.Actor Clutter.Container Clutter.Container Clutter.Container->Clutter.Actor Clutter.Scriptable Clutter.Scriptable Clutter.Scriptable->Clutter.Actor GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface GObject.GInterface->Champlain.Location GObject.GInterface->Clutter.Animatable GObject.GInterface->Clutter.Container GObject.GInterface->Clutter.Scriptable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Clutter.Actor GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

Champlain.Marker (15), Clutter.Actor (238), GObject.Object (37), Clutter.Animatable (5), Clutter.Container (17), Clutter.Scriptable (4), Champlain.Location (3)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_from_file (filename)

class

new_full (text, actor)

class

new_with_image (actor)

class

new_with_text (text, font, text_color, label_color)

get_alignment ()

get_attributes ()

get_color ()

get_draw_background ()

get_draw_shadow ()

get_ellipsize ()

get_font_name ()

get_image ()

get_single_line_mode ()

get_text ()

get_text_color ()

get_use_markup ()

get_wrap ()

get_wrap_mode ()

set_alignment (alignment)

set_attributes (list)

set_color (color)

set_draw_background (background)

set_draw_shadow (shadow)

set_ellipsize (mode)

set_font_name (font_name)

set_image (image)

set_single_line_mode (mode)

set_text (text)

set_text_color (color)

set_use_markup (use_markup)

set_wrap (wrap)

set_wrap_mode (wrap_mode)

Virtual Methods

Inherited:

Clutter.Actor (35), GObject.Object (7), Clutter.Animatable (5), Clutter.Container (13), Clutter.Scriptable (4), Champlain.Location (3)

Properties

Inherited:

Champlain.Marker (3), Clutter.Actor (82), Champlain.Location (2)

Name

Type

Flags

Short Description

alignment

Pango.Alignment

r/w

The label’s alignment

color

Clutter.Color

r/w

The label’s color

draw-background

bool

r/w

The label has a background

draw-shadow

bool

r/w

The label background has a shadow

ellipsize

Pango.EllipsizeMode

r/w

The label’s text ellipsize mode

font-name

str

r/w

The label’s text font name

image

Clutter.Actor

r/w

The image of the label

single-line-mode

bool

r/w

The label’s single line mode

text

str

r/w

The text of the label

text-color

Clutter.Color

r/w

The label’s text color

use-markup

bool

r/w

The text uses markup

wrap

bool

r/w

The label’s text wrap

wrap-mode

Pango.WrapMode

r/w

The label’s text wrap mode

Signals

Inherited:

Champlain.Marker (4), Clutter.Actor (26), GObject.Object (1), Clutter.Container (3)

Fields

Inherited:

Champlain.Marker (4), Clutter.Actor (26), GObject.Object (1), Clutter.Container (3)

Name

Type

Access

Description

parent

Champlain.Marker

r

Class Details

class Champlain.Label(**kwargs)
Bases:

Champlain.Marker

Abstract:

No

Structure:

Champlain.LabelClass

The Champlain.Label structure contains only private data and should be accessed using the provided API

New in version 0.10.

classmethod new()
Returns:

a new Champlain.Label ready to be used as a Clutter.Actor.

Return type:

Clutter.Actor

Creates a new instance of Champlain.Label.

New in version 0.10.

classmethod new_from_file(filename)
Parameters:

filename (str) – The filename of the image.

Raises:

GLib.Error

Returns:

a new Champlain.Label with a drawn label containing the given image.

Return type:

Clutter.Actor

Creates a new instance of Champlain.Label with image loaded from file.

New in version 0.10.

classmethod new_full(text, actor)
Parameters:
  • text (str) – The text of the label

  • actor (Clutter.Actor) – The image as a ClutterActor

Returns:

a new Champlain.Label with a drawn label containing the given image.

Return type:

Clutter.Actor

Creates a new instance of Champlain.Label consisting of a custom Clutter.Actor.

New in version 0.10.

classmethod new_with_image(actor)
Parameters:

actor (Clutter.Actor) – The image as a ClutterActor.

Returns:

a new Champlain.Label with a drawn label containing the given image.

Return type:

Clutter.Actor

Creates a new instance of Champlain.Label with image.

New in version 0.10.

classmethod new_with_text(text, font, text_color, label_color)
Parameters:
Returns:

a new Champlain.Label with a drawn label containing the given text.

Return type:

Clutter.Actor

Creates a new instance of Champlain.Label with text value.

New in version 0.10.

get_alignment()
Returns:

the label’s text alignment.

Return type:

Pango.Alignment

Get the label’s text alignment.

New in version 0.10.

get_attributes()
Returns:

the label’s text attributes.

Return type:

Pango.AttrList

Gets the label’s text attributes.

New in version 0.10.

get_color()
Returns:

the label’s background color.

Return type:

Clutter.Color

Gets the label’s background color.

New in version 0.10.

get_draw_background()
Returns:

if the label has a background.

Return type:

bool

Checks whether the label has a background.

New in version 0.10.

get_draw_shadow()
Returns:

if the label’s background has a shadow.

Return type:

bool

Checks whether the label’s background has a shadow.

New in version 0.12.10.

get_ellipsize()
Returns:

the label’s text ellipsize mode.

Return type:

Pango.EllipsizeMode

Gets the label’s text ellipsize mode.

New in version 0.10.

get_font_name()
Returns:

the label’s font name.

Return type:

str

Gets the label’s font name.

New in version 0.10.

get_image()
Returns:

the label’s image.

Return type:

Clutter.Actor

Get the label’s image.

New in version 0.10.

get_single_line_mode()
Returns:

the label’s text single line mode.

Return type:

bool

Checks the label’s single line mode.

New in version 0.10.

get_text()
Returns:

the label’s text.

Return type:

str

Get the label’s text.

New in version 0.10.

get_text_color()
Returns:

the label’s text color.

Return type:

Clutter.Color

Gets the label’s text color.

New in version 0.10.

get_use_markup()
Returns:

if the label’s text contains markup.

Return type:

bool

Check whether the label uses markup.

New in version 0.10.

get_wrap()
Returns:

if the label’s text wraps.

Return type:

bool

Checks whether the label text wraps.

New in version 0.10.

get_wrap_mode()
Returns:

the label’s text wrap mode.

Return type:

Pango.WrapMode

Gets the label’s text wrap mode.

New in version 0.10.

set_alignment(alignment)
Parameters:

alignment (Pango.Alignment) – The label’s alignment

Sets the label’s text alignment.

New in version 0.10.

set_attributes(list)
Parameters:

list (Pango.AttrList) – The label’s text attributes.

Sets the label’s text attributes.

New in version 0.10.

set_color(color)
Parameters:

color (Clutter.Color or None) – The label’s background color or None to reset the background to the default color. The color parameter is copied.

Sets the label’s background color.

New in version 0.10.

set_draw_background(background)
Parameters:

background (bool) – value.

Sets if the label has a background.

New in version 0.10.

set_draw_shadow(shadow)
Parameters:

shadow (bool) – value.

Sets if the label’s background has a shadow.

New in version 0.12.10.

set_ellipsize(mode)
Parameters:

mode (Pango.EllipsizeMode) – The label’s ellipsize mode.

Sets the label’s text ellipsize mode.

New in version 0.10.

set_font_name(font_name)
Parameters:

font_name (str or None) – The label’s font name or None to reset the font to the default value.

Sets the label’s font name such as “Sans 12”.

New in version 0.10.

set_image(image)
Parameters:

image (Clutter.Actor or None) – The image as a ClutterActor or None to remove the current image.

Sets the label’s image.

New in version 0.10.

set_single_line_mode(mode)
Parameters:

mode (bool) – The label’s single line mode

Sets if the label’s text is on a single line.

New in version 0.10.

set_text(text)
Parameters:

text (str) – The new text of the label

Sets the label’s text.

New in version 0.10.

set_text_color(color)
Parameters:

color (Clutter.Color or None) – The label’s text color or None to reset the text to the default color. The color parameter is copied.

Sets the label’s text color.

New in version 0.10.

set_use_markup(use_markup)
Parameters:

use_markup (bool) – The value

Sets if the label’s text uses markup.

New in version 0.10.

set_wrap(wrap)
Parameters:

wrap (bool) – The label’s wrap.

Sets if the label’s text wrap.

New in version 0.10.

set_wrap_mode(wrap_mode)
Parameters:

wrap_mode (Pango.WrapMode) – The label’s wrap mode.

Sets the label’s text wrap mode.

New in version 0.10.

Property Details

Champlain.Label.props.alignment
Name:

alignment

Type:

Pango.Alignment

Default Value:

Pango.Alignment.LEFT

Flags:

READABLE, WRITABLE

The label’s alignment

New in version 0.10.

Champlain.Label.props.color
Name:

color

Type:

Clutter.Color

Default Value:

<Color structure at 0x000000000000 (ClutterColor at 0x0000000)>

Flags:

READABLE, WRITABLE

The label’s color

New in version 0.10.

Champlain.Label.props.draw_background
Name:

draw-background

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If the label has a background

New in version 0.10.

Champlain.Label.props.draw_shadow
Name:

draw-shadow

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If the label background has a shadow

New in version 0.12.10.

Champlain.Label.props.ellipsize
Name:

ellipsize

Type:

Pango.EllipsizeMode

Default Value:

Pango.EllipsizeMode.NONE

Flags:

READABLE, WRITABLE

The label’s ellipsize mode

New in version 0.10.

Champlain.Label.props.font_name
Name:

font-name

Type:

str

Default Value:

'Sans 11'

Flags:

READABLE, WRITABLE

The label’s text font name

New in version 0.10.

Champlain.Label.props.image
Name:

image

Type:

Clutter.Actor

Default Value:

None

Flags:

READABLE, WRITABLE

The image of the label

New in version 0.10.

Champlain.Label.props.single_line_mode
Name:

single-line-mode

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If the label is in single line mode

New in version 0.10.

Champlain.Label.props.text
Name:

text

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

The text of the label

New in version 0.10.

Champlain.Label.props.text_color
Name:

text-color

Type:

Clutter.Color

Default Value:

<Color structure at 0x000000000000 (ClutterColor at 0x0000000)>

Flags:

READABLE, WRITABLE

The label’s text color

New in version 0.10.

Champlain.Label.props.use_markup
Name:

use-markup

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If the label’s text uses markup

New in version 0.10.

Champlain.Label.props.wrap
Name:

wrap

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If the label’s text wrap is set

New in version 0.10.

Champlain.Label.props.wrap_mode
Name:

wrap-mode

Type:

Pango.WrapMode

Default Value:

Pango.WrapMode.WORD

Flags:

READABLE, WRITABLE

The label’s text wrap mode

New in version 0.10.