[gtkmm] Pango weirdness


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

  // 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 =

  label->property_attributes() = attrlist;  //  <- segfault

What am I missing? Since the AttrList.insert() requires an 'Attribute &'
and not a 'const Attribute &', I'm suspecting that perhaps the
semantics are different from what I expect.

The relevant part of the stacktrace:

  #5  0x40be2898 in sigaction () from /lib/libc.so.6
  #6  0x408dedfe in pango_attr_list_copy () from /usr/lib/libpango-1.0.so.0
  #7  0x40a0a510 in g_value_dup_boxed () from /usr/lib/libgobject-2.0.so.0
  #8  0x40a0a603 in g_value_set_boxed () from /usr/lib/libgobject-2.0.so.0
  #9  0x403c5476 in Glib::ValueBase_Boxed::set_boxed(void const*) ()
     from /usr/lib/libglibmm-2.0.so.1
  #10 0x0808467c in Glib::Value_Boxed<Pango::AttrList>::set(Pango::AttrList const&) (this=0xbffff560, data= 0xbffff610)
      at /usr/include/gtkmm-2.0/glibmm/value.h:205
  #11 0x08084568 in Glib::PropertyProxy<Pango::AttrList>::set_value(Pango::AttrList const&) (this=0xbffff5f0, data= 0xbffff610)
      at /usr/include/gtkmm-2.0/glibmm/propertyproxy.h:109
  #12 0x08084380 in Glib::PropertyProxy<Pango::AttrList>::operator=(Pango::AttrList const&) (this=0xbffff5f0, data= 0xbffff610)
      at /usr/include/gtkmm-2.0/glibmm/propertyproxy.h:47

Ole Laursen

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