[gtkada] Problem writing a librsvg Ada binding

Jeffrey Creem jeff at thecreems.com
Thu Dec 28 01:37:50 CET 2006


  Damien Carbonne wrote:

> Hi,
>
> I'm trying to write a librsvg Ada binding and have a problem with it.
> As librsvg depends on glib/gdk, I've used GtkAda for that.
> Note: This binding will be available using the same license as GtkAda 
> on which it depends.
>
...stuff deleted

> I wrote this by following what is done for Gtk_New in Gtk.Window.
>
> But when I use all this, it fails and I get these messages:
>
> ===============================================================
> (process:18095): GLib-GObject-CRITICAL **: gtype.c:2240: 
> initialization assertion failed, use IA__g_type_init() prior to this 
> function
>
> (process:18095): GLib-GObject-CRITICAL **: gtype.c:2240: 
> initialization assertion failed, use IA__g_type_init() prior to this 
> function
>
> (process:18095): GLib-GObject-CRITICAL **: g_object_new: assertion 
> `G_TYPE_IS_OBJECT (object_type)' failed
> ===============================================================
>
> I have not found any procedure that binds g_type_init in GtkAda.
>

First one thought that might be helpful. Within the source distribution 
for GtkAda there is a perl script which helps build bindings to Gtk/Glib 
libraries. (generate.pl). Not sure if it will be helpful in this case, 
but it is worth knowing about.

Now, as for your specific question, any chance that g_type_init normally 
gets called behind the scenes by calls to   Gtk.Main.Init.

What I mean is that perhaps Gtkada does not bind to it because it binds 
to something like GtkInit that calls that routine for it?

This is an uninformed guess so take it as a suggestion of something to 
try (Calling Gtk.Main.Init). Perhaps you are already doing this but I 
could not tell from the example.




More information about the gtkada mailing list