Re: [Vala] connecting/disconnecting a signal to a static member function?
- From: pancake <pancake youterm com>
- To: Yu Feng <rainwoodman gmail com>
- Cc: Vala-list <vala-list gnome org>
- Subject: Re: [Vala] connecting/disconnecting a signal to a static member function?
- Date: Sat, 9 Oct 2010 12:24:17 +0200
The signal connecting has become more strict. You should fix all
function signatures to match the type of the first argument.
I did not tried to do this from static methods.
On Oct 9, 2010, at 6:50 AM, Yu Feng <rainwoodman gmail com> wrote:
Dear List,
Now that += and -= are deprecated syntax for signal handlers, I am
trying to update some signal code into the connect/disconnect syntax
on Vala 0.11.0.
Here is the problem I couldn't get myself out from:
1. the signal connecting / disconnecting is performed in a static
member function.
2. the signal handlers are also static member function with no
'instance' pointers.
If I blindly replace the '-=' syntax with disconnect I get an error
message like this:
gtk-widget.vala:110.29-110.45: error: Argument 1: Cannot convert
from `Widget.recursive_changed' to `GLib.Object.notify'
widget.notify.disconnect(recursive_changed);
The signature of widget.recursive_changed is:
private static void recursive_changed(Gtk.Widget widget,
ParamSpec pspec);
I remember there is a way of declaring the handler with has_instance
= 0 in the CCode annotations, but it wont work in this case as I am
calling disconnect from a static member function and can't access an
instance member.
How shall I achieve this? The warning messages about -= and += are
getting very annoying(too many of them).
Regards,
Yu
_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]