calling wxInitializeStockObjects early

Alex Fenton alex at deleteme.pressure.to
Thu Jan 4 12:39:15 PST 2007


Hi

I am looking for a way to do enough initialization of wxWidgets (2.6.3, for now) in C++ so that I can call wxInitializeStockObjects, but without committing myself to running a particular wxApp object.

The need for this is in wxRuby. We want constants such as Wx::RED, Wx::NULL_BITMAP (which correspond to wx stock objects) to be available as soon as the ruby library (wxruby2.so) is loaded, which is before we're able to create in C++ the instance of wxRubyApp that will actually be run.

The wrapper code currently does call wxInitializeStockObjects before there is an wxApp, and before we use Entry() to enter the main loop in a platform specific way. However, this causes a load of serious warnings on GTK, eg

(process:11017): GLib-GObject-CRITICAL **: gtype.c:2240: initialization assertion failed, use IA__g_type_init() prior to this function

Is there some way to do enough initialization to avoid these warnings, without instantiating the App that will eventually be run?

TIA
alex

PS - there have been a couple of wxruby2-preview releases since our last announcement to this newsgroup. Recent major additions to the port include the printing framework, the html framework, plus the usual fixes and extra features. It's still not quite ready for production use, though.
http://rubyforge.org/projects/wxruby/







More information about the wx-users mailing list