Expand description
Cross-platform input box library.
The entry point is the InputBox struct, which you can configure using
the builder pattern and then call InputBox::show to display the input
dialog and get the user’s input.
§Usage
ⓘ
use inputbox::InputBox;
let input = InputBox::new().title("Title").prompt("Prompt").default_text("Default");
let result: Option<String> = input.show().unwrap();
// Or use a specific backend:
// let result = input.show_with(&inputbox::backend::Zenity::default());
println!("Result: {:?}", result);Asynchronous versions of the show methods are also available:
ⓘ
use inputbox::InputBox;
let input = InputBox::new().title("Title").prompt("Prompt").default_text("Default");
input.show_async(|result| {
println!("Async result: {:?}", result);
});See crate::backend for details on the available backends and their
individual features and limitations.
Modules§
- backend
- Backend implementations for different platforms.
Structs§
- Input
Box - An input box configuration.
Enums§
- Input
Mode - Input mode for the input box.
Constants§
- DEFAULT_
CANCEL_ LABEL - Default label for the cancel button.
- DEFAULT_
OK_ LABEL - Default label for the OK/confirm button.
- DEFAULT_
TITLE - Default title for the input box dialog.