liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.89k stars 286 forks source link

Add more features to the patterns arg for file dialogs. #1567

Closed SiegeLord closed 4 months ago

SiegeLord commented 5 months ago

Here's the new docstring for it:

patterns: A string containing newline separated sets of patterns to match. A pattern is either a shell-style glob pattern (e.g. "*.txt") or a MIME type (e.g. "image/png"). Not all platforms support both (and some don't even support globs), so a portable solution is to specify a MIME type and simple style globs which Allegro will pick from to match what the platform supports (e.g. do "image/png;*.png"). Multiple patterns are separated using a semicolon. If the platform does not provide support for patterns, this parameter is ignored. Here are some example patterns:

connorjclark commented 5 months ago

I think this is a great backwards compatible way to extend this - nice!

only thing I wanna note is this disallows / from the description component of the filter. Maybe consider adding a way to escape a /?