Re: [Vala] Question about signal connection



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 like: // g_signal_connect (monitor, "changed", (GCallback) ((void) g_signal_emit_by_name (self, "handler2")));
and that is how it should be:
//          g_signal_connect (instance, detailed_signal, c_handler, data)
any idea?

Andrea Bolognani wrote:
On Sat, Nov 07, 2009 at 12:33:58PM +0100, Johan wrote:

Hi,
I wanna check if a file has been changed, and then take some action.
[...]
public static int main (string[] args) {
   var file = File.new_for_path ("test.png");
   var monitor = file.monitor_file(FileMonitorFlags.NONE);
   monitor.connect("changed",handler2);
   return 0;
   }
}

Try using

        monitor.changed.connect(handler2);

that should do the trick.





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