File: basic_model.rs

package info (click to toggle)
rust-nutmeg 0.1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 352 kB
  • sloc: makefile: 2
file content (12 lines) | stat: -rw-r--r-- 369 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
//! Use of [nutmeg::models::BasicModel].

pub fn main() {
    let view = nutmeg::View::new(
        nutmeg::models::BasicModel::new((0, 10), |(a, b)| format!("{a}/{b} complete")),
        nutmeg::Options::default(),
    );
    for _i in 0..10 {
        view.update(|model| model.value.0 += 1);
        std::thread::sleep(std::time::Duration::from_millis(150));
    }
}