Skip to main content

install_undo_bridge

Function install_undo_bridge 

Source
pub fn install_undo_bridge(
    can_undo: Signal<bool>,
    can_redo: Signal<bool>,
    undo_label: Signal<String>,
    redo_label: Signal<String>,
    on_invoke: impl Fn(bool) + 'static,
)
Expand description

Wire an undo history to the platform (docs/model.md): the four signals mirror into the toolkit’s native front where one exists (Cap::UndoBridge: the stock Edit menu retitles and enables itself, the platform’s gestures land), and every invocation the platform delivers comes back through on_invoke(redo). On a toolkit without a native undo system the state goes nowhere and the app’s own affordances call the stack directly; installing the bridge is still harmless. Call once, after launch; installing again replaces the wiring.