Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OS-native file dialogs on Linux, OS X and Windows

License

NotificationsYou must be signed in to change notification settings

saurvs/nfd-rs

Repository files navigation

nfd-rs is a Rust binding to the librarynativefiledialog, that provides a convenient cross-platform interface to opening file dialogs on Linux, OS X and Windows.

This crate has been tested on Mac, Window and Linux (Ubuntu 14.04) and supports single/mutliple and save dialogs, notice APIs may break with newer versions.

Usage

  • Add the dependencynfd in yourCargo.toml

    [dependencies]nfd ="0.0.4"
  • Open a single file dialog

    externcrate nfd;use nfd::Response;fnmain(){let result = nfd::open_file_dialog(None,None).unwrap_or_else(|e|{panic!(e);});match result{Response::Okay(file_path) =>println!("File path = {:?}", file_path),Response::OkayMultiple(files) =>println!("Files {:?}", files),Response::Cancel =>println!("User canceled"),}}
  • Open a multi file dialog using builder with jpg files as filter

    externcrate nfd;use nfd::Response;fnmain(){let result = nfd::dialog_multiple().filter("jpg").open().unwrap_or_else(|e|{panic!(e);});match result{Response::Okay(file_path) =>println!("File path = {:?}", file_path),Response::OkayMultiple(files) =>println!("Files {:?}", files),Response::Cancel =>println!("User canceled"),}}

Screenshot

Cocoa on El Capitan

About

OS-native file dialogs on Linux, OS X and Windows

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2025 Movatter.jp