diff --git a/hui-examples/boilerplate.rs b/hui-examples/boilerplate.rs index e40b817..afc36bd 100644 --- a/hui-examples/boilerplate.rs +++ b/hui-examples/boilerplate.rs @@ -29,7 +29,7 @@ macro_rules! ui_main { /// Initializes glium renderer, `UiInstance`, and runs the event loop. pub fn ui( mut init: impl FnMut(&mut UiInstance) -> T, - mut draw: impl FnMut(&mut UiInstance, Vec2, &T), + mut draw: impl FnMut(&mut UiInstance, Vec2, &mut T), name: &'static str ) { kubi_logging::init(); diff --git a/hui-examples/examples/ui_test_5_input.rs b/hui-examples/examples/ui_test_5_input.rs index 22237b2..93fe27a 100644 --- a/hui-examples/examples/ui_test_5_input.rs +++ b/hui-examples/examples/ui_test_5_input.rs @@ -16,8 +16,10 @@ mod boilerplate; ui_main!( "hUI: Internal input test", - init: |_| {}, - run: |ui, size, _| { + init: |_| { + 0 + }, + run: |ui, size, n| { Container::default() .with_size(size!(100%)) .with_align(Alignment::Center) @@ -30,6 +32,7 @@ ui_main!( .into_interactable() .on_click(|| { println!("clicked"); + *n += 1; }) .add_child(ui); })