[Vala] notify for synthetic properties?



Hey people,

Say you have a GObject with a synthetic property, the value of which depends on some other value, e.g.:

public string value {
    get { return entry.get_text(); }
    set { entry.set_text(value); }
}

private Gtk.Entry entry;

You want to want to get notifies when the synthetic property changes, which is obviously dependent on the value being used.

So you can manually add handlers for the dependent value and call notify_property("value") when it changes, or you can use GObject bindings. But both of these suck since they add code cruft that is off somewhere far away from the declarations, and that makes it hard to maintain and understand what is going with the values.

Is there a nicer way to do this in vala?

//Mike

--
⊨ Michael Gratton, Percept Wrangler.
⚙ <http://mjog.vee.net/>




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