Re: GType stuff again!
- From: Johannes Schmid <johannes schmid gmx de>
- To: Murray Cumming <murrayc murrayc com>
- Cc: gtkmm-list gnome org, paul linuxaudiosystems com
- Subject: Re: GType stuff again!
- Date: Tue, 19 Sep 2006 21:32:25 +0200
-----BEGIN PGP SIGNED MESSAGE-----
I solved the loading now by writing my own glue code but I ran into
another problem now.
When I construct my class it has the type
which is correct. Anyway, if this GObject is passed back to the C code
the type now is GObject which is or course wrong. Of course I call
Anjuta::init() from the C code before to register the new types but this
does not seem to help.
Without having the correct type I won't be able to call any virtual
functions or to connect to signals.
Murray Cumming wrote:
>> On Tue, 2006-09-19 at 11:43 +0200, Johannes Schmid wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>> I tried out the examples in gtkmm to find out if they are able to handle
>>> their GTypenames correclty. Unfortunately they do not:
>>> std::cout << g_type_name(get_type()) << std::endl;
> Maybe get_type() isn't returning what we think it's returning, but I'm
> fairly sure that custom gtypes are being created.
>>> in the cellrenderercustom example just gives me
>>> "gtkmm__GtkCellRenderer". But of course g_object_new(type) will give not
>>> give me a custom but a standart CellRenderer.
>>> Anyway, I still need something that gives me a custom type that
>>> g_object_new can handle.
>> i am confused. since g_object_new cannot possibly instantiate a C++
>> object, what is the value of get_type() returning a value that can be
>> used at the C level?
>> you can't create C++ objects (the ones that gtkmm is composed of) from C
>> without a *lot* more glue code (eg. factory functions declared extern
>> "C" that return each type of object as a gpointer etc etc)
> But maybe we really can make it work, by registering an appropriate init
> function for our new GType. It would be clever though.
> Murray Cumming
> murrayc murrayc com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v184.108.40.206 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
] [Thread Prev