Re: [Vala] Multiple properties, one signal for any change. [RESOLVED]



On 17/11/2013 11:14, Luca Bruno wrote:
https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-notify
In vala should be obj.notify.connect (...).

Sweet, thanks.

Small demo:

public class Stuff : Object {
  public string prop1 {get;set;}
  public string prop2 {get;set;}
  public string prop3 {get;set;}
}

public void changed( ParamSpec p) {
  stdout.printf("Changed %s\n", p.get_name ());
}

public void main() {
  var s = new Stuff();
  s.notify.connect ( changed );

  s.prop1 = "Foo";
  s.prop2 = "Bar";
  s.prop3 = "Baz";
}



\d


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