Clutter 0.8.2 Reference Manual | ||||
---|---|---|---|---|
ClutterLabel; ClutterLabelClass; ClutterActor* clutter_label_new (void); ClutterActor* clutter_label_new_with_text (const gchar *font_name, const gchar *text); ClutterActor* clutter_label_new_full (const gchar *font_name, const gchar *text, const ClutterColor *color); void clutter_label_set_text (ClutterLabel *label, const gchar *text); const gchar* clutter_label_get_text (ClutterLabel *label); void clutter_label_set_font_name (ClutterLabel *label, const gchar *font_name); const gchar* clutter_label_get_font_name (ClutterLabel *label); void clutter_label_set_color (ClutterLabel *label, const ClutterColor *color); void clutter_label_get_color (ClutterLabel *label, ClutterColor *color); void clutter_label_set_ellipsize (ClutterLabel *label, PangoEllipsizeMode mode); PangoEllipsizeMode clutter_label_get_ellipsize (ClutterLabel *label); void clutter_label_set_line_wrap (ClutterLabel *label, gboolean wrap); gboolean clutter_label_get_line_wrap (ClutterLabel *label); void clutter_label_set_line_wrap_mode (ClutterLabel *label, PangoWrapMode wrap_mode); PangoWrapMode clutter_label_get_line_wrap_mode (ClutterLabel *label); PangoLayout* clutter_label_get_layout (ClutterLabel *label); void clutter_label_set_attributes (ClutterLabel *label, PangoAttrList *attrs); PangoAttrList* clutter_label_get_attributes (ClutterLabel *label); void clutter_label_set_use_markup (ClutterLabel *label, gboolean setting); gboolean clutter_label_get_use_markup (ClutterLabel *label); void clutter_label_set_alignment (ClutterLabel *label, PangoAlignment alignment); PangoAlignment clutter_label_get_alignment (ClutterLabel *label); gboolean clutter_label_get_justify (ClutterLabel *label); void clutter_label_set_justify (ClutterLabel *label, gboolean justify);
"alignment" PangoAlignment : Read / Write "attributes" PangoAttrList* : Read / Write "color" ClutterColor* : Read / Write "ellipsize" PangoEllipsizeMode : Read / Write "font-name" gchar* : Read / Write "justify" gboolean : Read / Write "text" gchar* : Read / Write "use-markup" gboolean : Read / Write "wrap" gboolean : Read / Write "wrap-mode" PangoWrapMode : Read / Write
ClutterActor* clutter_label_new (void);
Creates a new, empty ClutterLabel.
Returns : |
the newly created ClutterLabel |
ClutterActor* clutter_label_new_with_text (const gchar *font_name, const gchar *text);
Creates a new ClutterLabel displaying text
using font_name
.
|
the name (and size) of the font to be used |
|
the text to be displayed |
Returns : |
a ClutterLabel |
ClutterActor* clutter_label_new_full (const gchar *font_name, const gchar *text, const ClutterColor *color);
Creates a new ClutterLabel displaying text
with color
using font_name
.
|
the name (and size) of the font to be used |
|
the text to be displayed |
|
ClutterColor for text |
Returns : |
a ClutterLabel |
void clutter_label_set_text (ClutterLabel *label, const gchar *text);
Sets text
as the text to be displayed by label
.
|
a ClutterLabel |
|
the text to be displayed |
const gchar* clutter_label_get_text (ClutterLabel *label);
Retrieves the text displayed by label
|
a ClutterLabel |
Returns : |
the text of the label. The returned string is owned by ClutterLabel and should not be modified or freed. |
void clutter_label_set_font_name (ClutterLabel *label, const gchar *font_name);
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.
|
a ClutterLabel |
|
a font name and size, or NULL for the default font
|
const gchar* clutter_label_get_font_name (ClutterLabel *label);
Retrieves the font used by label
.
|
a ClutterLabel |
Returns : |
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.
|
void clutter_label_set_color (ClutterLabel *label, const ClutterColor *color);
Sets the color of label
.
|
a ClutterLabel |
|
a ClutterColor |
void clutter_label_get_color (ClutterLabel *label, ClutterColor *color);
Retrieves the color of label
.
|
a ClutterLabel |
|
return location for a ClutterColor |
void clutter_label_set_ellipsize (ClutterLabel *label, PangoEllipsizeMode mode);
Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string.
|
a ClutterLabel |
|
a PangoEllipsizeMode |
Since 0.2
PangoEllipsizeMode clutter_label_get_ellipsize (ClutterLabel *label);
Returns the ellipsizing position of the label.
See clutter_label_set_ellipsize()
.
|
a ClutterLabel |
Returns : |
PangoEllipsizeMode |
Since 0.2
void clutter_label_set_line_wrap (ClutterLabel *label, gboolean wrap);
Toggles line wrapping within the ClutterLabel widget. TRUE
makes
it break lines if text exceeds the widget's size. FALSE
lets the
text get cut off by the edge of the widget if it exceeds the widget
size.
|
a ClutterLabel |
|
the setting |
Since 0.2
gboolean clutter_label_get_line_wrap (ClutterLabel *label);
Returns whether lines in the label are automatically wrapped.
See clutter_label_set_line_wrap()
.
|
a ClutterLabel |
Returns : |
TRUE if the lines of the label are automatically wrapped.
|
Since 0.2
void clutter_label_set_line_wrap_mode (ClutterLabel *label, PangoWrapMode 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.
|
a ClutterLabel |
|
the line wrapping mode |
Since 0.2
PangoWrapMode clutter_label_get_line_wrap_mode (ClutterLabel *label);
Returns line wrap mode used by the label.
See clutter_label_set_line_wrap_mode()
.
|
a ClutterLabel |
Returns : |
TRUE if the lines of the label are automatically wrapped.
|
Since 0.2
PangoLayout* clutter_label_get_layout (ClutterLabel *label);
Gets the PangoLayout 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.
|
a ClutterLabel |
Returns : |
the PangoLayout for this label |
Since 0.2
void clutter_label_set_attributes (ClutterLabel *label, PangoAttrList *attrs);
Sets a PangoAttrList; 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 TRUE
.
|
a ClutterLabel |
|
a PangoAttrList |
Since 0.2
PangoAttrList* clutter_label_get_attributes (ClutterLabel *label);
Gets the attribute list that was set on the label using
clutter_label_set_attributes()
, if any.
|
a ClutterLabel |
Returns : |
the attribute list, or NULL if none was set.
|
Since 0.2
void clutter_label_set_use_markup (ClutterLabel *label, gboolean setting);
Sets whether the text of the label contains markup in Pango's text markup language.
|
a ClutterLabel |
|
TRUE if the label's text should be parsed for markup.
|
gboolean clutter_label_get_use_markup (ClutterLabel *label);
Returns whether the label's text is interpreted as marked up with
the Pango text markup
language. See clutter_label_set_use_markup()
.
|
a ClutterLabel |
Returns : |
TRUE if the label's text will be parsed for markup.
|
void clutter_label_set_alignment (ClutterLabel *label, PangoAlignment alignment);
Sets text alignment of the label.
The alignment will only be used when the contents of the
label are enough to wrap, and the "wrap"
property is set to TRUE
.
|
a ClutterLabel |
|
A PangoAlignment |
PangoAlignment clutter_label_get_alignment (ClutterLabel *label);
Returns the label's text alignment
|
a ClutterLabel |
Returns : |
The label's PangoAlignment Since 0.2 |
gboolean clutter_label_get_justify (ClutterLabel *label);
Retrieves whether the label should justify the text on both margins.
|
a ClutterLabel |
Returns : |
TRUE if the text should be justified
|
Since 0.6
void clutter_label_set_justify (ClutterLabel *label, gboolean justify);
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.
|
a ClutterLabel |
|
whether the text should be justified |
Since 0.6
"alignment"
property"alignment" PangoAlignment : Read / Write
The preferred alignment for the string.
Default value: PANGO_ALIGN_LEFT
"attributes"
property"attributes" PangoAttrList* : Read / Write
A list of style attributes to apply to the text of the label.
"ellipsize"
property"ellipsize" PangoEllipsizeMode : Read / Write
The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.
Default value: PANGO_ELLIPSIZE_NONE
"font-name"
property"font-name" gchar* : Read / Write
Pango font description.
Default value: NULL
"justify"
property"justify" gboolean : Read / Write
Whether the contents of the label should be justified on both margins.
Default value: FALSE
Since 0.6
"use-markup"
property"use-markup" gboolean : Read / Write
The text of the label includes XML markup. See pango_parse_markup().
Default value: FALSE
"wrap"
property"wrap" gboolean : Read / Write
If set, wrap lines if the text becomes too wide.
Default value: FALSE
"wrap-mode"
property"wrap-mode" PangoWrapMode : Read / Write
If wrap is set, controls how line-wrapping is done.
Default value: PANGO_WRAP_WORD