Re: [Vala] Question about signal connection

2009-11-18 Thread Johan
Hi Frederik, Thanks a lot, it works perfectly. regards, Johan Frederik wrote: public class HelloVala: GLib.Object { static void handler2 (FileMonitor monitor, File file, File? other_file, FileMonitorEvent event_type) { // ... } public static int

[Vala] Question about signal connection

2009-11-07 Thread Johan
Hi, I wanna check if a file has been changed, and then take some action. However I am not getting the trick with the signal connection. the code below returns: (process:18773): GLib-GObject-WARNING **: IA__g_object_connect: invalid signal spec changed well I have checked the specs of GLIB and

Re: [Vala] Question about signal connection

2009-11-07 Thread Frederik
Johan wrote: Hi, I wanna check if a file has been changed, and then take some action. However I am not getting the trick with the signal connection. the code below returns: (process:18773): GLib-GObject-WARNING **: IA__g_object_connect: invalid signal spec changed well I have checked the

Re: [Vala] Question about signal connection

2009-11-07 Thread Johan
Hi Andrea, Thanks for the fast reply. I am still doing something wrong, I changed this: public virtual signal void handler2 (...) monitor.changed.connect((void) this.handler2); and get the following: macro g_signal_connect requires 4 arguments, but only 3 given That is how the C-code looks

Re: [Vala] Question about signal connection

2009-11-07 Thread Nicolas
Hi Joan, Try this: Signal.connect(monitor, changed, (GLib.Callback)handler2, monitor); Nicolas. ___ Vala-list mailing list Vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list

Re: [Vala] Question about signal connection

2009-11-07 Thread Jan Hudec
On Sat, Nov 07, 2009 at 13:16:02 +0100, Johan wrote: Hi Andrea, Thanks for the fast reply. I am still doing something wrong, I changed this: public virtual signal void handler2 (...) No 'signal' keyword here. A handler is just a function. It must have a signature that matches the signal it

Re: [Vala] Question about signal connection

2009-11-07 Thread Jan Hudec
On Sat, Nov 07, 2009 at 14:47:16 +0100, Nicolas wrote: Signal.connect(monitor, changed, (GLib.Callback)handler2, monitor); No. That won't work without some magic applied to handler2, because the call signature for signal handlers is different from regular methods. The normal syntax: