convenience API for applying PangoAttributes to a GtkLabel
- From: Sven Neumann <sven gimp org>
- To: gtk-devel-list gnome org
- Subject: convenience API for applying PangoAttributes to a GtkLabel
- Date: Mon, 12 Mar 2007 23:09:34 +0100
Hi,
libgimpwidgets includes an API for conveniently apply PangoAttributes to
a GtkLabel and I wonder if I should propose it for inclusion in GTK+:
http://developer.gimp.org/api/2.0/libgimpwidgets/libgimpwidgets-GimpWidgets.html#gimp-label-set-attributes
It is IMO more convenient than using g_strdup_printf() to embed a string
into PangoMarkup. Here's a short example to make a label large and bold:
gimp_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_SCALE, PANGO_SCALE_LARGE,
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
-1);
The implementation can be reviewed in
http://svn.gnome.org/viewcvs/gimp/trunk/libgimpwidgets/gimpwidgets.c?view=markup
Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]