Filefilter not working as expected

Following is the code:

var imagesFilter:FileFilter = new FileFilter("Images", "*.jpg;*.gif;*.png");
 var myFileReference:FileReference = new FileReference();
 myFileReference.browse([imagesFilter]);

when window opens, it doesn’t show the allowed type, I mean images. Instead in the type select menu it has something like:

>.jpg,gif,png

I tried to dig it but stuck at lime/6,0,1/…/native/NativeCFFI.hx

There’s an open TODO on this:

I believe some platforms use commas, some use semicolons, and some use vertical bars to separate the filter types. Have you tried other combinations, such as "*.jpg|*.gif|*.png" or dropping the asterisks?

On the other hand, perhaps it is consistent now (we did change file dialog libraries some time ago), and we just need to do some pre-processing on our end to make it consistent

I personally like the format you shared in your example code, we could do some work on the Haxe side before hitting the native side to convert from one format to the one

EDIT: Sorry, that’s the wrong dialog library. I think that’s what we used to use, and now use tinyfiledialogs:

https://sourceforge.net/projects/tinyfiledialogs/files/

1 Like