Function rui::modview

source ·
pub fn modview<S: Clone + Default + 'static, V: View, F: Fn(S, &mut Context) -> V + 'static>(
    f: F
) -> ModView<S, F>
Expand description

Passes a value to a function. Value can be updated by modifiers.

Examples found in repository?
examples/custom_modifier.rs (lines 20-25)
19
20
21
22
23
24
25
26
fn my_control() -> impl MyMods {
    modview(|t, _| {
        circle().color(match t {
            MyControlType::Chill => AZURE_HIGHLIGHT,
            MyControlType::Agro => RED_HIGHLIGHT,
        })
    })
}