RE: Assertion from gtk_notebook_append_page



> -----Original Message-----
> From: David Necas 
> Sent: Sunday, December 06, 2009 12:43 PM
> 
> >
> > I'm getting this printed on every call to add a page to a
> GtkNotebook,
> >
> > (hcpgui.exe:3628): Gtk-CRITICAL **: gtk_container_foreach: assertion
> > `GTK_IS_CONTAINER (container)' failed
> >
> 
> And the backtrace is (use G_DEBUG=fatal-criticals)?  I.e. how it gets
> to gtk_container_foreach()?

Once I'd eventually realized that G_DEBUG=fatal-criticals is an environment
variable and not a compiler define...

The backtrace revealed the problem. When gtk_notebook_append_page is called
it is emitting a "switch-page" event on the notebook and I have a signal
handler installed for that. A call from that signal handler leads to the
assert because it not expecting to be called yet and is using data that
doesn't get initialized until after the notebook has been built. This I can
easily fix.

Thanks
Ian





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