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



On Wed, 2006-11-22 at 18:06 +0100, Oliver Nittka wrote:
> Murray Cumming schrieb:
> >> another possibility would be to glade_register_widget() each of our
> >> widgets in glade_module_register_widgets(), with a custom *_new function
> 
> > So it doesn't seem like much extra work to make sure that the C++
> > instance is instantiated before the properties are set.
> 
> well, seems it actually /is/ some extra work ;-)
> 
> libglade instantiates the GObject, assigns the properties and only then
> libglademm wraps the GObject into a C++ Object.
> 
> Trouble is, the custom properties of your class are already registered
> (Glib::Property does this automatically for us, which is like magic ;-)

I'm fairly sure that only happens when the C++ object is instantiated,
because that's when the property proxies are instantiated, and when the
custom GType is created.

So, the question is What is this time between GType instantiation and
full C++ instantiation, and how is libglade doing anything during that
time.

libglademm has nothing to do with this. It's not involved with Glade at
all.

>  but the according set_property() functions (which point to
> custom_set_property_callback() ) cannot work because at that time, there
> is no Glib::Property-instance to store the values, yet.
> 
> when later the Glib::Property-members of your Widget get created, their
> values are just set to the default, so using your own widget in a glade
> file would mean to manually set it's custom properties after loading the
> glade file, or, as Alexander pointed out, to write an adapter function
> for each and every property in your catalog file.
> 
> the other possibility (glade_register_widget() with custom *_new -
> function) does not yet work for me, but I'm at it :-)
> 
>   --o
-- 
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]