Re: Why GObject::constructor, not GObject::construct?


Owen Taylor <otaylor redhat com> writes:

> So, why don't we just have a ->construct() virtual function that
> is called after g_type_create_instance() and the construct parameters
> are set?

Yes, I have stumpled across that problem when porting our object
deserialization code to glib-2.0. I found a working solution with
the current API, but it is more than ugly.

> Also, don't we need a g_object_newv() that takes a list of name/value
> pairs, since g_object_new()/g_object_new_valist() isn't language
> bindable? Or are language bindings supposed to call
> g_object_constructor() directly? (It seems a little painful to figure
> out which arguments are construct parameters, etc.)

Yes, sorting out the construct_parameters is a pain in the ass, but
I couldn't find a way to access the functionality in gobject with the
current API. The API you propose (name/value pairs) would be very nice
to have.

Salut, Sven

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