Next: ClutterListModel, Previous: ClutterGroup, Up: Top
Actor for displaying text
<clutter-label>
is a <clutter-actor>
that displays text using
Pango.
Derives from
<clutter-actor>
.This class defines the following slots:
font-name
- Pango font description
text
- Text to render
color
- Font Colour
attributes
- A list of style attributes to apply to the text of the label
use-markup
- The text of the label includes XML markup. See pango_parse_markup()
alignment
- The preferred alignment for the string
wrap
- If set, wrap lines if the text becomes too wide
wrap-mode
- If wrap is set, controls how line-wrapping is done
justify
- Whether the contents of the label should be justified
ellipsize
- The preferred place to ellipsize the string, if the label does not have enough room to display the entire string
<clutter-actor>
)Creates a new, empty
<clutter-label>
.
- ret
- the newly created
<clutter-label>
mchars
) (text mchars
) (ret <clutter-actor>
)Creates a new
<clutter-label>
displaying text using font-name.
- font-name
- the name (and size) of the font to be used
- text
- the text to be displayed
- ret
- a
<clutter-label>
mchars
) (text mchars
) (color <clutter-color>
) (ret <clutter-actor>
)Creates a new
<clutter-label>
displaying text with color using font-name.
- font-name
- the name (and size) of the font to be used
- text
- the text to be displayed
- color
<clutter-color>
for text- ret
- a
<clutter-label>
<clutter-label>
) (text mchars
)Sets text as the text to be displayed by label.
- label
- a
<clutter-label>
- text
- the text to be displayed
<clutter-label>
) (ret mchars
)Retrieves the text displayed by label
- label
- a
<clutter-label>
- ret
- the text of the label. The returned string is owned by
<clutter-label>
and should not be modified or freed.
<clutter-label>
) (font_name mchars
)Sets font-name as the font used by label.
font-name must be a string containing the font name and its size, similarly to what you would feed to the
pango-font-description-from-string
function.
- label
- a
<clutter-label>
- font-name
- a font name and size, or ‘
#f
’ for the default font
<clutter-label>
) (ret mchars
)Retrieves the font used by label.
- label
- a
<clutter-label>
- ret
- a string containing the font name, in a format understandable by
pango-font-description-from-string
. The string is owned by label and should not be modified or freed.
<clutter-label>
) (color <clutter-color>
)Sets the color of label.
- label
- a
<clutter-label>
- color
- a
<clutter-color>
<clutter-label>
) (color <clutter-color>
)Retrieves the color of label.
- label
- a
<clutter-label>
- color
- return location for a
<clutter-color>
<clutter-label>
) (mode <pango-ellipsize-mode>
)Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string.
- label
- a
<clutter-label>
- mode
- a
<pango-ellipsize-mode>
Since 0.2
<clutter-label>
) (ret <pango-ellipsize-mode>
)Returns the ellipsizing position of the label. See
clutter-label-set-ellipsize
.
- label
- a
<clutter-label>
- ret
<pango-ellipsize-mode>
Since 0.2
<clutter-label>
) (wrap bool
)Toggles line wrapping within the
<clutter-label>
widget. ‘#t
’ makes it break lines if text exceeds the widget's size. ‘#f
’ lets the text get cut off by the edge of the widget if it exceeds the widget size.
- label
- a
<clutter-label>
- wrap
- the setting
Since 0.2
<clutter-label>
) (ret bool
)Returns whether lines in the label are automatically wrapped. See
clutter-label-set-line-wrap
.
- label
- a
<clutter-label>
- ret
- ‘
#t
’ if the lines of the label are automatically wrapped.Since 0.2
<clutter-label>
) (wrap_mode <pango-wrap-mode>
)If line wrapping is on (see
clutter-label-set-line-wrap
) this controls how the line wrapping is done. The default is ‘PANGO_WRAP_WORD’ which means wrap on word boundaries.
- label
- a
<clutter-label>
- wrap-mode
- the line wrapping mode
Since 0.2
<clutter-label>
) (ret <pango-wrap-mode>
)Returns line wrap mode used by the label. See
clutter-label-set-line-wrap-mode
.
- label
- a
<clutter-label>
- ret
- ‘
#t
’ if the lines of the label are automatically wrapped.Since 0.2
<clutter-label>
) (ret <pango-layout>
)Gets the
<pango-layout>
used to display the label. The layout is useful to e.g. convert text positions to pixel positions. The returned layout is owned by the label so need not be freed by the caller.
- label
- a
<clutter-label>
- ret
- the
<pango-layout>
for this labelSince 0.2
<clutter-label>
) (attrs <pango-attr-list>
)Sets a
<pango-attr-list>
; the attributes in the list are applied to the label text. The attributes set with this function will be ignored if the "use_markup" property is ‘#t
’.
- label
- a
<clutter-label>
- attrs
- a
<pango-attr-list>
Since 0.2
<clutter-label>
) (ret <pango-attr-list>
)Gets the attribute list that was set on the label using
clutter-label-set-attributes
, if any.
- label
- a
<clutter-label>
- ret
- the attribute list, or ‘
#f
’ if none was set.Since 0.2
<clutter-label>
) (setting bool
)Sets whether the text of the label contains markup in Pango's text markup language.
- label
- a
<clutter-label>
- setting
- ‘
#t
’ if the label's text should be parsed for markup.
<clutter-label>
) (ret bool
)Returns whether the label's text is interpreted as marked up with the Pango text markup language. See
clutter-label-set-use-markup
.
- label
- a
<clutter-label>
- ret
- ‘
#t
’ if the label's text will be parsed for markup.
<clutter-label>
) (alignment <pango-alignment>
)Sets text alignment of the label.
- label
- a
<clutter-label>
- alignment
- A
<pango-alignment>
<clutter-label>
) (ret <pango-alignment>
)Returns the label's text alignment
- label
- a
<clutter-label>
- ret
- The label's
<pango-alignment>
Since 0.2
<clutter-label>
) (ret bool
)Retrieves whether the label should justify the text on both margins.
- label
- a
<clutter-label>
- ret
- ‘
#t
’ if the text should be justifiedSince 0.6
<clutter-label>
) (justify bool
)Sets whether the text of the label actor should be justified on both margins. This setting is ignored if Clutter is compiled against Pango < 1.18.
- label
- a
<clutter-label>
- justify
- whether the text should be justified
Since 0.6