Is is possible to limit the file extensions in an allegro ALLEGRO_FILECHOOSER_SAVE dialogue? Specifically, I want to limit the extensions to the bitmap types .png, .bmp, .jpg, etc. with descriptions if possible. Something like this:
{"name":"606200","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/6\/06b4a778d987329f3d702f1187cac5ae.png","w":489,"h":384,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/6\/06b4a778d987329f3d702f1187cac5ae"}
uhhhh....
That's very not the answer.
(but funny)
Well use your native OS file system with globbing then.
Maybe I phrased my question the wrong way. I'm trying to limit the extensions in which the user is allowed to save.
Does the patterns argument of the al_create_native_file_dialog do nothing?
Does the patterns argument of the al_create_native_file_dialog do nothing?
Not in this case. It limits what I can view, but I can still save as any filetype.
{"name":"606201","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/2\/d254b2ad4a1bacbd986e45d62583fc28.png","w":949,"h":626,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/2\/d254b2ad4a1bacbd986e45d62583fc28"}
To be more specific, I'm letting the user use the native save dialog to export an image file, but I'm limited to the extensions that Allegro can save. I don't want the user to try and save an image file as "mypicture.txt".
I'm not sure there is a way to stop the user from typing in an extension that is not valid, at least not that I've seen. Most programs I've used let you type in any extension, and if it does not match the extension(s) it is looking for it appends the expected one onto it as though you only typed a file name (ex saving a Word document as document.txt will cause it to save as document.txt.doc).
EDIT: If that does not seem pleasing to you, you could always check the extension (if there is one), and if it is not one of the supported saving types notify the user.
It's still nice to have a list of extensions. Then the user can pick one and it gets tacked on automatically.