wxMozilla

The c wxMozillaDemo works lovely. The wxPython stuff all works fine too.
But the wxMozilla python demo does not. It throws:

(process:16932): GLib-GObject-CRITICAL **: gtype.c:1871: initialization
assertion failed, use g_type_init() prior to this function
(process:16932): GLib-GObject-CRITICAL **: file gobject.c: line 615
(g_object_new): assertion `G_TYPE_IS_OBJECT (object_type)' failed

Sounds like something is not being initialized before being used...

Funny, I get something similar with my embedding attempt. When I run some simple script like

import _core
import core
wx=core
menubar=wx.MenuBar()

(process:697): GLib-GObject-CRITICAL **: gtype.c:1807:g_type_register_static(): initialization assertion failed, use g_type_init() prior to this function
(process:697): GLib-GObject-CRITICAL **: gtype.c:1807:g_type_register_static(): initialization assertion failed, use g_type_init() prior to this function
(process:697): Gtk-CRITICAL **: file gtktypeutils.c: line 40 (gtk_type_unique): assertion `GTK_TYPE_IS_OBJECT (parent_type)' failed

(process:697): GLib-GObject-CRITICAL **: gtype.c:1807:g_type_register_static(): initialization assertion failed, use g_type_init() prior to this function
(process:697): GLib-GObject-CRITICAL **: file gtype.c: line 1873 (g_type_add_interface_static): assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
...

Robin's suggestion that something is not being init-ed properly sounds intriguing. As a fresh wxPy newbie, it doesn't help me much though. But if you find what's the fix to your GLib whining problem, I'd sure be interested to know it.

Cheers,
Vio

Vio wrote:

The c wxMozillaDemo works lovely. The wxPython stuff all works fine too.
But the wxMozilla python demo does not. It throws:

(process:16932): GLib-GObject-CRITICAL **: gtype.c:1871: initialization
assertion failed, use g_type_init() prior to this function
(process:16932): GLib-GObject-CRITICAL **: file gobject.c: line 615
(g_object_new): assertion `G_TYPE_IS_OBJECT (object_type)' failed

Sounds like something is not being initialized before being used...

Funny, I get something similar with my embedding attempt. When I run some simple script like

import _core
import core
wx=core
menubar=wx.MenuBar()

In this case at least you need to create a wx.App object before the menubar. I'm working on a (hopefully) simple way to detect this and raise an exception without imopsing too much overhead in the normal case where an app object has already been created.

ยทยทยท

import wx

>>> a = wx.PySimpleApp()
>>> mb = wx.MenuBar()
>>>

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!