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

use dialog::backends;
use dialog::DialogBox;

fn main() -> dialog::Result<()> {
    let mut backend = backends::KDialog::new();

    dialog::Message::new("This is a message.")
        .title("And this is a title:")
        .show_with(&backend)?;

    backend.set_icon("error");
    dialog::Message::new("This is an error message.")
        .title("Error")
        .show_with(&backend)
}