Skip to main content

text_input/
text_input.rs

1fn main() {
2	let mode = match std::process::id() / 4 % 3 {
3		0 => rustydialogs::TextInputMode::SingleLine,
4		1 => rustydialogs::TextInputMode::MultiLine,
5		_ => rustydialogs::TextInputMode::Password,
6	};
7
8	let input = rustydialogs::TextInput {
9		title: "TextInput",
10		message: "Enter some text:",
11		value: "default value",
12		mode,
13		owner: None,
14	};
15
16	match input.show() {
17		Some(value) => println!("TextInput: {value}"),
18		None => println!("Canceled"),
19	}
20}