changing pango attributes



Hi,

I've made a gtklabel with an underline attribute:
pango_attr_underline_new(PANGO_UNDERLINE_ERROR);
The label shows up fine with this attribtute.

However, later on I want to dynamically change this attribute
to PANGO_UNDERLINE_NONE.
The code basically looks like this:

attrlist=gtk_label_get_attributes(label);
iter=pango_attr_list_get_iterator(attrlist);

do{
  attribute=pango_attr_iterator_get(iter,PANGO_ATTR_UNDERLINE);
}while(pango_attr_iterator_next(iter));

Now, the problem is this:
attribute=pango_attr_iterator_get(iter,PANGO_ATTR_UNDERLINE);
doesn't really give me the attribute, does it? After all,

typedef struct {
  const PangoAttrClass *klass;
  guint start_index;/* in bytes */
  guint end_index;/* in bytes. The character at this index is not included */
} PangoAttribute;

typedef struct {
  PangoAttrType type;
  PangoAttribute * (*copy) (const PangoAttribute *attr);
  void             (*destroy) (PangoAttribute *attr);
  gboolean         (*equal) (const PangoAttribute *attr1, const
PangoAttribute *attr2);
} PangoAttrClass;

and in this last struct I only can acces the type, but not it's values.
I'm looking for a way to get the struct used for

typedef struct {
  PangoAttribute attr;
  int value;
} PangoAttrInt;

so that I can set the int value to PANGO_UNDERLINE_NONE.
I have studied the pango API a lot, but can't find a way to get
access to the underline attribute itself. Am I missing something
simple here?

Thanks in advance for your help.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]