long/
long.rs

1///
2/// Example of a long list. (run this example yourself)
3///
4
5fn main() {
6    use terminal_menu::{menu, button, run, mut_menu};
7    let menu = menu(
8
9        // create buttons representing numbers from 1 to 100
10        (1..100).map(|n| button(format!("{}", n))).collect()
11
12    );
13    run(&menu);
14    if mut_menu(&menu).canceled() {
15        println!("Canceled!");
16        return;
17    }
18    println!("{}", mut_menu(&menu).selected_item_name());
19}