mirror of
https://github.com/griffi-gh/hUI.git
synced 2024-11-29 02:18:40 -06:00
make arg mut
This commit is contained in:
parent
2d59f76ba7
commit
197b327b1f
|
@ -29,7 +29,7 @@ macro_rules! ui_main {
|
||||||
/// Initializes glium renderer, `UiInstance`, and runs the event loop.
|
/// Initializes glium renderer, `UiInstance`, and runs the event loop.
|
||||||
pub fn ui<T>(
|
pub fn ui<T>(
|
||||||
mut init: impl FnMut(&mut UiInstance) -> T,
|
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
|
name: &'static str
|
||||||
) {
|
) {
|
||||||
kubi_logging::init();
|
kubi_logging::init();
|
||||||
|
|
|
@ -16,8 +16,10 @@ mod boilerplate;
|
||||||
|
|
||||||
ui_main!(
|
ui_main!(
|
||||||
"hUI: Internal input test",
|
"hUI: Internal input test",
|
||||||
init: |_| {},
|
init: |_| {
|
||||||
run: |ui, size, _| {
|
0
|
||||||
|
},
|
||||||
|
run: |ui, size, n| {
|
||||||
Container::default()
|
Container::default()
|
||||||
.with_size(size!(100%))
|
.with_size(size!(100%))
|
||||||
.with_align(Alignment::Center)
|
.with_align(Alignment::Center)
|
||||||
|
@ -30,6 +32,7 @@ ui_main!(
|
||||||
.into_interactable()
|
.into_interactable()
|
||||||
.on_click(|| {
|
.on_click(|| {
|
||||||
println!("clicked");
|
println!("clicked");
|
||||||
|
*n += 1;
|
||||||
})
|
})
|
||||||
.add_child(ui);
|
.add_child(ui);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue