On Wed, Sep 29, 2010 at 4:10 AM, Lance Dillon <riffraff...@yahoo.com> wrote:
> I'm trying to add gtkbuilder support to pike (pike.roxen.com).
>
> In loading a glade3 file, it says Invalid Object 'blah', unless I create an
> instance of the object first.  I narrowed it down to (in gtkbuilder.c):

Unless your object is already in a dynamically linkable .so file linked
in to the application; you need to compile your application with
  `pkg-config --cflags --libs gmodule-2.0`
This will ensure your applications globally visible symbols are
also exported (it boils down to the linker getting --export-dynamic)

Otherwise GtkBuilder has no way to search your type name
from your application.

Cheers,
         -Tristan


>
> static GType
> gtk_builder_real_get_type_from_name (GtkBuilder  *builder,
>                                     const gchar *type_name)
> {
>  GType gtype;
>
>  gtype = g_type_from_name (type_name);
>  if (gtype != G_TYPE_INVALID)
>    return gtype;
>
>  return _gtk_builder_resolve_type_lazily (type_name);
> }
>
> Which as you can see, calls _gtk_builder_resolve_type_lazily().  That function
> loads the module using GModule, using NULL to load the symbols of itself, find
> the *_get_type() function of the object, and calls it to get the type.  The
> type, of course, is not created until the first time it is used.
>
> For some reason, my code doesn't do that.  The binding is a .so file that is
> dynamically loaded into the pike interpreter, so I'm hazarding a guess that it
> gets the symbols to the current module, which is not libgtk-x11.so (on linux
> anyway), so it can't find the *_get_type() function, so it gets 
> G_TYPE_INVALID.
> I've been trying different things and so far nothing is working.
>
> Does anybody have any idea how to get around this, to make it resolve 
> properly?
>
> Thanks
>
>
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to