backend_dialog/
backend-dialog.rs

1// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org>
2// SPDX-License-Identifier: MIT
3
4use dialog::backends;
5use dialog::DialogBox;
6
7fn main() -> dialog::Result<()> {
8    let mut backend = backends::Dialog::new();
9
10    dialog::Message::new("This is a message.")
11        .title("And this is a title:")
12        .show_with(&backend)?;
13
14    backend.set_backtitle("Backtitle");
15    dialog::Message::new("This is a message.")
16        .title("And this is a title:")
17        .show_with(&backend)?;
18
19    backend.set_width(100);
20    backend.set_height(10);
21    dialog::Message::new("This is a message with a fixed size.")
22        .title("And this is a title:")
23        .show_with(&backend)
24}