Method
GtkLabelset_markup
Declaration [src]
void
gtk_label_set_markup (
GtkLabel* self,
const char* str
)
Description [src]
Sets the labels text and attributes from markup.
The string must be marked up with Pango markup
(see pango_parse_markup()
).
If str
is external data, you may need to escape it
with g_markup_escape_text()
or g_markup_printf_escaped()
:
GtkWidget *self = gtk_label_new (NULL);
const char *str = "...";
const char *format = "<span style=\"italic\">\%s</span>";
char *markup;
markup = g_markup_printf_escaped (format, str);
gtk_label_set_markup (GTK_LABEL (self), markup);
g_free (markup);
This function sets the GtkLabel:use-markup
property
to true.
Also see gtk_label_set_text()
.