Re: Let's not use ... args



Murray Cumming <murrayc usa net> writes:
> I've noticed that GnomeMessageBox and the GnomeCanvas items use ... arguments.
> Not only does this make for an unclear and un-typed API, it is also impossible
> to wrap properly in some language bindings, because it is not possible to
> build the variable argument structure dynamically.
> 

It's easy to wrap, just do this:

void
set_whatever (thetype whatever)
{
 gtk_object_set (object, "whatever", whatever, NULL);
}

You can autogenerate that by querying the arg list on the object even.
For dynamic languages you can autogenerate it at runtime.

Havoc




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