Skip to main content

Module rebuilder

Module rebuilder 

Source
Expand description

Rebuilder — regenerate a child subtree when an external version changes.

agg-gui trees are built once; widgets whose content set is dynamic (a picker whose options change, a list whose row count changes) can’t express that with setters alone. Rebuilder closes the gap: give it a cheap version_fn and a builder; each layout pass it compares the version and rebuilds the child when it moved. The declarative-UI equivalent of keying a subtree by its data identity.

let list = Rebuilder::new(
    move || items.borrow().len() as u64,
    move || build_rows(&items.borrow(), &font),
);

Keep version_fn cheap (it runs every layout) and derive it from the data the builder reads — hash names, count rows, bump a counter.

Structs§

Rebuilder