pub fn modview<S: Clone + Default + 'static, V: View, F: Fn(S, &mut Context) -> V + 'static>( f: F ) -> ModView<S, F>
Passes a value to a function. Value can be updated by modifiers.
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, }) }) }