Skip to content

how to select local file or directory #1597

Answered by willser
wanghaisheng asked this question in Q&A
Discussion options

You must be logged in to vote

You need rfd.Following #987 .

Those code work fine in my project.

if file_button.clicked() {
    if let Some(path) = rfd::FileDialog::new().pick_file() {
        *path_buf = Some(path);
    }
}

If you want to choose a folder,you could use pick_folder function.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by emilk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants