ZERO DIALOG
An ultra-lightweight, dependency-free system dialog library. Adds no GUI dependencies, requires no linking, and introduces zero extra code complexity.
Designed to show system-native dialogs as a last-resort user-facing error/exception handler without adding project bloat.
Design Goals
- Zero Rust dependencies
- Minimal code footprint
- No forced GUI toolkit dependencies
- No link-time library requirements
- Cross-platform (Windows/Linux)
Dynamically loads system GUI components at runtime:
- Uses Win32 API controls on Windows
- Attempts GTK3 dialogs on Linux
Usage Example
Show a modal dialog with title Hello, content World, warning icon, and an OK button (closes when clicked):
show;
Show error icon with OK / Cancel buttons and capture user choice:
let title = "Fatal Error";
let msg = "Required assets not found, click Ok to exit";
let config = DialogConfig ;
let result = show;
match result
Suitable for use after panic!() to display critical errors.
use panic;
use show;
Styling & Icons
Dialogs inherit native system styling. On Windows:
- Defaults to legacy Windows XP visual style
- Modern styling requires manual theming (affects entire application)
- Handle system theme changes with caution
To modify control styles on Windows, do this:
# Cargo.toml
[]
= "0.1"
// build.rs
Known Limitations
- Heavy use of unsafe code
- Fails silently if OS lacks required GUI components
- Dynamic loading may introduce unexpected behavior
- No control over visual appearance