[Vala] [Genie] Signals and callbacks
- From: Alex Stefan Kaye <noxdeleo googlemail com>
- To: vala-list gnome org
- Subject: [Vala] [Genie] Signals and callbacks
- Date: Thu, 11 Apr 2013 13:41:35 +0001
Hi all,
I'm new to Vala/Genie having come from using Python with GObject
introspected bindings etc. I'm having a bit of a hard time getting to
grips with the differences. One of the things that just came up is with
regards to connecting callbacks to signals/events. In this case, I'm
trying to connect to a Clutter.ButtonEvent on a Clutter.Stage:
stage.button_press_event.connect(self.on_clicked)
..
def on_clicked(ev:Clutter.ButtonEvent)
...
This gives me the following error:
error: Argument 1: Cannot convert from `MyClass.on_click' to
`Clutter.Actor.button_press_event'
Some searching netted some mention of passing delegates using lambda
(or something like that) on the Vala side, but I've no idea how to do
that in Genie (if that's even what I need). Thanks in advance.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]