Re: [AD] native filechooser addon |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
2009/2/23 Evert Glebbeek <eglebbk@xxxxxxxxxx>:
> On 22-Feb-09, at 6:52 PM, Elias Pschernig wrote:
>> I think any A5 program not using the events system is broken. If it
>> was
>> for me, we would remove the functions to get "current" mouse/keyboard
>> state :P
>
> Well...
> I'll have to agree to the point that I don't see myself not using the
> event system now that I'm used to it. ;)
>
>> Yeah, I wanted to avoid having to provide another function to free
>> such
>> an array (free() could not be used).
>
> Yes, that's the problem. However, right now, there is a problem: if we
> allow the user to select an arbitrary number of files, we also need a
> way to return all that information to the user. Right now, some of it
> will just be lost.
> I don't know what the best solution would be though...
> Ok, I may know: have a function that initialises a FILE_PICKER object
> and returns it, a function that uses the FILE_PICKER object to get a
> list of files from the user and an accessor function that gets the
> data back from the FILE_PICKER object to the program. That's adding
> yet another datatype though...
Why not export the ALLEGRO_NATIVE_FILE_CHOOSER type that already exists
internally?
ALLEGRO_NATIVE_FILE_CHOOSER *al_create_file_chooser();
void al_popup_file_chooser(ALLEGRO_NATIVE_FILE_CHOOSER *);
int al_get_num_chosen_filenames(ALLEGRO_NATIVE_FILE_CHOOSER *);
const char *al_get_chosen_filename(ALLEGRO_NATIVE_FILE_CHOOSER *, int);
void al_destroy_file_chooser(ALLEGRO_NATIVE_FILE_CHOOSER *);
Btw, I prefer "picker". After all, you can pick your nose but you can't
choose your nose. Except in Hollywood.
Peter