Re: [AD] native filechooser addon

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 2009-02-22 at 10:10 -0800, Evert Glebbeek wrote:
> On 20-Feb-09, at 9:58 AM, Elias Pschernig wrote:
> > For things like a level editor, it can be really useful to display the
> > system's standard file-open dialog to select files - even if the  
> > rest of
> > the program uses just Allegro 5. The attached addon adds two functions
> > to allow it.
> >
> > For now, only a GTK filechooser is implemented. But if someone wants  
> > to
> > add Windows/OSX/Qt versions, I think this will be quite nice.
> 
> I personally think it's fine to add this to SVN already. I had a quick  
> look at what's there and it should be fairly straightforward to make  
> an OS X version for this. Two quick comments about that though:
> 1. The OS X file will be osx.m, not osx.c. This shouldn't be a problem.
> 2. OS X allows you to specify a list of extensions (without the  
> leading .); it does not appear to allow you to specify a full pattern  
> to match. Arguably it would be more useful for the file-dialog addon  
> to work this way too, I think.
> 

I agree. I didn't add any filtering to the GTK version yet, because I
couldn't come up with a good way how to pass the info yet. Basically, my
initial idea was like:

"*.png;*.jpg;*.*"

This would have added a drop-down box with those three choices, so
either you would get only .png files, only .jpg files, or all files.

However, what makes more sense would be if I get a drop-down box with:
Pictures (*.png;*.jpg)
All Files

So if it is to be passed as a single string, it might look like:

"Pictures(png;jpg);All Files(*)"

But it's a very minor feature, so not sure it's worth adding a parser
for such filter strings.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/