Re: [gtkmm] Pango weirdness



Ole Laursen <olau hardworking dk> writes:

> I'm programming an applet which is supposed to show some text - now,
> the space on the panel is rather limited so I thought I would support
> changing the font of the labels I'm using. But the following
> segfaults:
> 
>   // font is a ustring from a Gnome::UI:FontPicker, e.g. "sans 12"
> 
>   Pango::AttrList attrlist;
>   
>   if (!font.empty()) {  // don't use default font
>     Pango::AttrFontDesc attr =
>       Pango::Attribute::create_attr_font_desc(Pango::FontDescription(font));
>     
>     attrlist.insert(attr);
>   }
> 
>   label->property_attributes() = attrlist;  //  <- segfault

Hm, perhaps I should rephrase my question. Has anyone succesfully
changed the font with Pangomm? Any hints? Is this a bug in the
library?

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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