Re: signal marshallers



On Sat, Jun 16, Warrior wrote:
Could somebody please point me to reasonably detailed documentation on signal 
marshallers? From what's available in API reference on www.gtk.org I 
understand that they provide a method to use a function that takes more than 
one argument as a callback (am I right here?), but it's still unclear to me 
how exactly one should use them. Some examples would be greatly appreciated.

A look at the source (gtkmarshal.c) demystifies this a lot, and for
simple purposes, this should help you: A marshal function is a
function which calls another function with arguments stored in a
GtkArg vector. This is necessary in C, since C supports converting
variable argument lists into vectors (va_start, va_arg, va_end), but
not vice versa (what e.g. apply does in Lisp).

If you define a signal (gtk_signal_new), you must use an appropriate
marshal function. There are several functions in gtkmarshal.c, their
names have the pattern

   gtk_marshal_<RETURN TYPE>__<ARG 1 TYPE>_<ARG 2 TYPE>_<...>

If you need to define a new marshal function, copy simply the code and
modify it for your needs, this is really simple.


Sebastian




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