jdm / tinyfiledialogs-rs

A Rust binding for the tinyfiledialogs library.
http://sourceforge.net/projects/tinyfiledialogs/
55 stars 22 forks source link

Filtering does not work on Windows in an open_file_dialog function #16

Closed fschutt closed 3 years ago

fschutt commented 6 years ago

I have a folder that has SVG files in it, I want to restrict the user to only be able to load files with an ".svg" extension. However, if I call tinyfiledialogs like this:

let dialog_result = open_file_dialog("Load SVG file", "", Some((&["svg"], "SVG file")));

... what I get (on Windows) is a dialog that doesn't let me select SVG files. It displays the "SVG file" correctly in the lower right corner, but it doesn't filter all SVG items. There is no documentation on how to use the filter correctly, since the example only uses None as the third parameter. I've also tried using ".svg" (with the extra dot), but that doesn't seem to do anything either.

Is there any way to get filtering to work or am I doing something stupid?

jdm commented 6 years ago

According to https://github.com/jdm/tinyfiledialogs-rs/blob/master/libtinyfiledialogs/tinyfiledialogs.h#L173 you need to use *.svg.

SamMorrowDrums commented 3 years ago

Can confirm this works, on Linux at least. I'm assuming this is resolved.