Tutorial by Examples

Signals are only available to GObject classes. They can only be public, which means that any part of the code can connect handlers and trigger them. public class Emitter : Object { // A signal is declared like a method, // but with the signal keyword. public signal void my_signal ();...
You can write detailed signals with the [Signal (detailed = true)] attribute. public class Emitter : Object { [Signal (detailed = true)] public signal void detailed_signal (); public void emit_with_detail (string detail) { this.detailed_signal[detail] (); } } void...
Signals can have a default handler. All you need to do is to give it a body when you declare it. public class Emitter : Object { public signal void my_signal () { print ("Hello from the default handler!\n"); } } This handler will always be called after the connected...

Page 1 of 1