Skip to content

Data binding #128

Description

@Berrysoft

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions