aboutsummaryrefslogtreecommitdiff
path: root/examples/input.rs
blob: d852a5e5a542a336c25a5bc8ecfa98b85e9be1c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org>
// SPDX-License-Identifier: MIT

use dialog::DialogBox;

fn main() -> dialog::Result<()> {
    let input1 = dialog::Input::new("Please enter something").show()?;
    let input2 = dialog::Input::new("Please enter something")
        .title("Input form")
        .show()?;
    let input3 = dialog::Input::new("Please enter something with a default")
        .title("Input form")
        .default("input")
        .show()?;

    println!("Input 1: {:?}", input1);
    println!("Input 2: {:?}", input2);
    println!("Input 3: {:?}", input3);
    Ok(())
}