Re: [gtk-list] Why doesn't GTK+...



> GTK+ allows one argument for functions like gtk_signal_connect()... why doesn't it allow multiple arguments using ellipses (...) as an argument? This could fit in many places, such as gtk_slist_append(), allowing you to append more than one thing at a time.

  You can't technically pass "..." argument - in the next call it MUST be passed
as va_list argument. And as you can't benefit from "...", for va_list passing
(which is sometimes also useful) you can use standard gtk_signal_connect()
as va_list is a pointer which can be casted to "gpointer".
  The only possibility would be to pass the total size of all passed arguments
and do a gross-hack when calling the "func" from inside signal-invoker but
it would be absolutely non-portable and also non-comfortable for the caller
to provide the sum of sizeof()s of all the supplied arguments.

> There could be two copies of the function allowing for backward compatibility. Doesn't the compiler choose which function to run based on the arguments?

  Only in C++, a no-no for GTK. (No flamewars please.)

  (I wanted it first to post it only privately and now I've decided to give a CC
to the list so please forgive lower text quality.)


  							Lace



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