cushy/examples/scroll.rs
Jonathan Johnson 79be9a063b
Scroll and Animations
Scroll is only working to the absolute barest of requirements.
2023-11-01 15:15:14 -07:00

21 lines
558 B
Rust

use gooey::value::Dynamic;
use gooey::widget::Widgets;
use gooey::widgets::{Button, Scroll, Stack};
use gooey::Run;
fn main() -> gooey::Result {
Scroll::new(Stack::rows(
(0..30)
.map(|i| {
let count = Dynamic::new(0);
Button::new(count.map_each(move |count| format!("Row {i}: {count}"))).on_click(
move |_| {
count.map_mut(|count| *count += 1);
},
)
})
.collect::<Widgets>(),
))
.run()
}