Re: Reverse-wrapping gtkmm widgets to gtk+ (for glade3)



On Mon, 2006-11-20 at 17:42 +0100, Murray Cumming wrote:
> > > > Maybe we could hook in a GObject init() function to the derived GType,
> > > > which would also create the C++ wrapper around it. 
> > > 
> > > Of course we wouldn't want this to run in addition to the regular
> > > constructor, when you are using this class without Glade.
> > 
> > I'm assuming that a GObject init function will only be called if the
> > object is created with a normal C g_object_new call?
> 
> Yes, but I think that's how we create the underlying C GObject even when
> we use a C++ constructor. It will need some thought/investigation to
> figure out how to best solve this.

Ok, I had a look at the glibmm code, and though I don't completely get
it, the C object is registered in class.cc, clone_custom_type. In the
GTypeInfo struct I see 0 for instance_init, just before the
register_static call is done. This would mean no hook is provided to get
in our own custom init function (unless the class.cc code is changed)?
Also, I haven't found any way to change the GTypeInfo record after the
GType is registered (and I can image that such is not allowed on
purpose).

Brgds,
  Alexander Brinkman.



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