Re: GType stuff again!



Please remember to CC gtkmm-list. I assume that you meant to.

[snip]
> Some short code:
>
> In the plugin:
>
> extern "C"
> {
>
> G_MODULE_EXPORT GObject* glue_constructor(GObject* shell);
> G_MODULE_EXPORT GObject*
> glue_constructor (GObject* shell)
> {
> 	Anjuta::SampleCpp* plugin =
> 		new Anjuta::SampleCpp(Glib::wrap(ANJUTA_SHELL(shell)));
> 	std::cout << g_type_name(plugin->get_type()) << std::endl;
> 	return G_OBJECT(plugin->gobj());
> }
>
> }
>>> Here type is gtkmm_AnjutaPlugin!
>
> In the glue factory, the constructor is called using some g_module stuff:
>
> /* Create the object */
> plugin =  (*constructor)(shell);
> g_message(g_type_name(G_OBJECT_TYPE(plugin)));
>
>
>>> Now I get GObject
>
> Looks all very strange to me!

Yes. Do try to simplify it by using G_OBJECT_TYPE_NAME(gobject) in both
parts, and check that it's really the same object, by printing out the
value of the pointer.

If you don't make progress, I can look at it some time if there are clear
instructions about how to reproduce it. For instance, what version of
Anjuta to build, what patch to apply, what to do in the UI to make this
test run.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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