Re: How to make an attribute list?



Le 14/04/2013 10:50, Ken Resander a écrit :
             //pango_attribute_init (???); // do I have to use this? how?
             a = pango_attr_foreground_new(sv->txtcol.r, sv->txtcol.g,
sv->txtcol.b );
             a->klass.type = PANGO_ATTR_FOREGROUND ; // compiler
complains about this
             a->start_index = sv->offset;
             a->end_index = a->start_index + sv->len;
             pango_attr_list_insert(al, a);

The pango_attr_*_new() functions return an attribute that is already initialized, so you don’t need to call pango_attribute_init() or set the class type.

Of the 6 quoted lines, you only need the second (the one with pango_attr_foreground_new().)

Cheers,
--
Simon Sapin


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