Mail Archives: djgpp/1999/08/03/23:27:43
Shawn Hargreaves wrote in message
<8D53104ECD0CD211AF4000A0C9D60AE301545DBD AT probe-2 DOT acclaim-euro DOT net>...
>B O'Donnell writes:
>> I want to be able to use the file selector to pick a working directory;
>> is this possible?
>
>No. You'll have to make your own modified version if you want to do this.
>As written, selecting a directory from the listbox is interpreted as
>wanting to look inside that directory, and closing the dialog without
>selecting anything is interpreted as cancelling it, so you can't use it
>to choose the working directory unless you change these behaviours.
>
>
> Shawn Hargreaves.
Actually, it can be done. Run this little program, find the directory you
want,
click on it once and click on OK.
#include <allegro.h>
int main(void)
{
char path[1000];
int i;
allegro_init();
install_keyboard();
install_mouse();
install_timer();
set_gfx_mode(GFX_SAFE, 320, 200, 0, 0);
i=file_select("Hello", path, "/d-ar");
allegro_exit();
printf("%i, %s\n", i, path);
return(0);
}
Pavlos
- Raw text -