[Vala] connecting/disconnecting a signal to a static member function?
- From: Yu Feng <rainwoodman gmail com>
- To: Vala-list <vala-list gnome org>
- Subject: [Vala] connecting/disconnecting a signal to a static member function?
- Date: Sat, 09 Oct 2010 00:50:17 -0400
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]