Re: gtkmm Label problem



> I created a blank Label as follow:
>
> Gtk::Label *lb=new Gtk::Label();
> Pango::AttrList ls=lb->get_attributes();
>
> "ls" is not NULL even no attribute was set. So there
> is an error when the following is executed.
>
> ls->get_iter();
>
> Pango-CRITICAL **: pango_attr_list_get_iterator::
> assertion `list != NULL' failed
>
> Questions:
>
> (1) Is the above a bug?

Yes, a bug in gtkmm, I think. It seems to be OK for
gtk_label_get_attributes() to return a NULL, so we need a
Pango::AttrList::operator bool(), so you can check for the a
non-valid/empty AttrList. I will add this to gtkmm's HEAD branch - please
use bugzilla if I forget.

> (2) How can I check if the Pango::AttrList is NULL?

For now, you could do
if(ls.gobj())

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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