Crates.io | zenity-dialog |
lib.rs | zenity-dialog |
version | 0.3.6 |
source | src |
created_at | 2024-05-28 05:43:14.702235 |
updated_at | 2024-06-03 05:02:25.511703 |
description | Provides a statically typed wrapper around the Zenity dialog rendering tool for Linux. |
homepage | |
repository | |
max_upload_size | |
id | 1254044 |
size | 33,937 |
A thin wrapper arround Zenity, a tool for rendering dialog boxes in Linux. This mvp version supports only a limitted number of Zenity options.
Note: This library assumes that Zenity is already installed and will throw an error if it isn't found. You will need to provide appropriate documentation in your application to convey the need to install Zenity.
Imagine you're building some kind of application that needs to get some input from the user under some circumstances, but for one reason or another the user can't expect to be able to see stdout. One case might be a background process that the user launched without sending stdout to the terminal; another might be a CLI tool that is invoked by a desktop application, perhaps as part of a plugin. This library allows you to display something that the user will definitely be able to see and respond to.
let result = ZenityDialog::new(dialog::Error::default().with_text("An error happened!"))
.with_icon(Icon::Error)
.show()?;
match result {
ZenityOutput::Affirmed { .. } => {
println!("The user clicked the affirmative response")
}
ZenityOutput::Rejected { .. } => println!("The user clicked the rejection response"),
ZenityOutput::Unknown {
exit_code,
stdout,
stderr,
} => println!("Something weird happened. {exit_code} {stdout} {stderr}"),
};
Enable automatic date parsing for the Calendar type using Chrono. When this feature is enabled, you won't be able to pass custom date formats to Zenity as this can interfere with Chrono's ability to properly parse the date.