Re: C++ and glue/gmodule



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

What arguments does Glib::ObjectBase constructor need to create a custom
type?

If I pass "SampleCpp" or typeid(SampleCpp), sample->get_type() still
gives me gtkmm__AnjutaPlugin.

Thanks,
Johannes

Murray Cumming wrote:
> On Mon, 2006-08-14 at 18:25 +0200, Johannes Schmid wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi!
>>
>> OK, anjuta does now receive the type but it uses gtkmm__AnjutaPlugin and
>> generates a general Anjuta::Plugin instead of the SampleCpp class
>> derived from Anjuta::Plugin!
> 
> Your SampleCpp needs to also call the ObjectBase constructor with a
> type. Actually, only the most derived classes need to do this.
> 
>> The problem is that I have only found examples where the constructor of
>> Glib::ObjectBase is called to receive a new custom type. But the
>> constructor is never called before the type is needed in my case.
> 
> Ah, yes, those functions called get_type() to instantiate the type. I
> guess you could instantiate an object and then call object.get_type().
> It's not very efficient but maybe it's OK.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE4X0f7Dsf+G5b/WsRAr+KAJoCbtlUJHgjHNy9tFUq/jAi+DTPSgCdHz52
9kiLAKMkuFtNfOcGLHf9bJc=
=WoZM
-----END PGP SIGNATURE-----



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