Crates.io | imfile |
lib.rs | imfile |
version | 0.1.0 |
source | src |
created_at | 2023-05-07 07:31:20.303755 |
updated_at | 2023-05-07 07:31:20.303755 |
description | A simple and customizable file dialog for imgui-rs written entirely in Rust. |
homepage | |
repository | https://github.com/tseli0s/imfile |
max_upload_size | |
id | 858996 |
size | 74,289 |
imgui-rs
>= 0.11.0Basic usage:
use imfile::FileDialog;
fn main() -> {
// set up your imgui::Ui here
// This returns None if no file was selected
if let Some(file) = FileDialog::new()
.for_save() // Default is open
.title("Title") // Default is "Open File" or "Save file" depending on the dialog type
.accept_text("Open file") // Default is open
.dir_only() // Only allow directories instead of files
.spawn(&ui); // Create the dialog using the imgui::Ui
{
println!("File chosen: {}", file.display());
} else {
println!("No file selected.");
}
}
The crate is licensed under the MIT license.