Re: Tricks of the trade



Murray,

> > (process:16588): GLib-GObject-CRITICAL **: gtype.c:2254: initialization assertion failed, use IA__g_type_init() prior to this function
> 
> Maybe you have a static instance that is executed before the Gtk::Main.

I had assumed it was something to do with the C++ pre-main
initialization.  My current hypothesis is that it is to do with a
Pango::FontDescription member that I have in a subclass of a
Gtk::ListStore and the fact that I create a single static instance.  I
had tried replacing it with a Pango::FontDescription* to make the item
primitive (not the right design but...)  but I got the same error
message which really baffled me.  Hence the email.

I am assuming the nth (where n is probably a single digit number) rule
of GTKmm programming is "no static variables or members of static
variables that are of some GTK based type unless they are contained in a
procedure scope where the procedure is executed after the creation of
the Gtk::Main or Gnome::Main object.".  

> A debugger (running with gtk applications with --g-fatal-errors gives
> helpful stacktraces when there are gtk+ warnings) and or valgrind can
> help.

Thanks for the tip.  I will give this a go.

Is there a Web page or Wiki with these sorts of helpful tips that I have
missed?

Thanks.
-- 
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             russel russel org uk

Attachment: signature.asc
Description: This is a digitally signed message part



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