wfd

Crates.iowfd
lib.rswfd
version0.1.7
sourcesrc
created_at2019-11-17 20:26:34.52351
updated_at2021-01-24 22:11:49.784234
descriptionA simple to use abstraction over the Open and Save dialogs in the Windows API
homepage
repositoryhttps://www.github.com/ben-wallis/wfd
max_upload_size
id182068
size29,472
Ben Wallis (ben-wallis)

documentation

README

wfd

Build Status Crates.io License: MIT

This crate provides a simple to use abstraction over the Open and Save dialogs in the Windows API, usable under both GNU and MSVC toolchains, with minimal dependencies.

Examples

Standard open dialog

let dialog_result = wfd::open_dialog(Default::default())?;

Folder picker open dialog

use wfd::{DialogParams};

let params = DialogParams {
    options: FOS_PICKFOLDERS,
    .. Default::default()
};

let dialog_result = wfd::open_dialog(params)?;

Save dialog with custom file extension filters

use wfd::{DialogParams};

let params = DialogParams {
    title: "Select an image to open",
    file_types: vec![("JPG Files", "*.jpg;*.jpeg"), ("PNG Files", "*.png"), ("Bitmap Files", "*.bmp")],
    default_extension: "jpg",
    ..Default::default()
};

let dialog_result = wfd::save_dialog(params)?;

Further examples can be found in src\examples

Commit count: 0

cargo fmt