Crate alerta

Crate alerta 

Source
Expand description

A minimal, self-contained library for creating simple GUI dialogs (“message boxes”) on X11.

Alerta can be used by applications that want to display a simple GUI message box to the user, but don’t want to pull in an entire GUI framework or invoke an external command like zenity.

There is also a small CLI tool that wraps this library, available in the alerta-cli package.

§Examples

use alerta::{Icon, ButtonPreset};

let answer = alerta::alerta()
    .title("Dialog Title")
    .message("This text will appear inside the dialog window.\n\nIt can contain multiple lines of text that will be soft-wrapped to fit in the window.")
    .icon(Icon::Warning)
    .button_preset(ButtonPreset::YesNoCancel)
    .show()?;

println!("{answer:?}");

Structs§

Builder
A message dialog builder.
Error
The main error type of this library.
InvalidValue
Error returned by FromStr implementations.

Enums§

Answer
A user response to a dialog.
ButtonPreset
Presets of button groups.
Icon
The icon to display in the dialog.
Theme
Color theme selection.

Functions§

alerta
Returns a Builder for creating dialogs.