Re: [Vala] vala-list Digest, Vol 61, Issue 7



2012/12/16 JM <interflug1 gmx net>

Overriding a signal or making it virtual does not really make sense,
does it?
A signal does not have a body, as a function would have and signature is
always the same, even in child classes.


Also your example seems weird, as you have bodys for signals.

Regards


No, signals in Vala can be virtual and can have bodies.
GObject offers so called "default handles" for signals,
which can be specified as an offset in the class struct to the handler
function pointer. Because the handler is in the class struct,
it can be "overriden" by subclasses, hence the analogy "virtual signal".
Vala translates the signal body to a virtual function and sets it as the
default handler for the signal.

 - Jonas


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