We need to provide a convenience way to bind the data.
Consider a type Property<T>, and make some properties like
pub fn text(&self) -> Result<Property<String>>;
pub fn set_text(&mut self, s: impl Into<Property<String>>) -> Result<()>;
and users could write
bar.set_text(foo.text()?)?;
The widget bar saves the Property and starts it in start(). When the property changes, foo posts a message to the Property, so bar could receive the event.
cc @mokurin000 for advice
We need to provide a convenience way to bind the data.
Consider a type
Property<T>, and make some properties likeand users could write
The widget
barsaves thePropertyand starts it instart(). When the property changes,fooposts a message to theProperty, sobarcould receive the event.cc @mokurin000 for advice