I've been trying out Vala lately and decided I would make a little app. So far I've managed to add a GtkLabel and GtkSwitch. I compiled it, and they show up just fine. Now, I want to link the switch to a function (silly me... they're called methods...) that runs whenever the switch state is changed, or, if possible, two separate methods, one for "switch on" and another for "switch off."
What signal should I connect to accomplish this? And how? The only thing I know about connecting signals is foo.signalname.connect(method), and from reading around, I get the idea that I have to do more than that.
Assume I'm a complete noob.
Thanks!