On Jul 19, 2007, at 11:30 PM, Suja wrote:
> Hi,
> Could someone tell me how I can pass the previously selected directory
> as an argument to the file chooser, so that when file_chooser
> widget appears second time, it shows the directory selected
> previously?
Just pass the file path and name as the third argument.
I like to do this in a function, so that the filechooser starts where
is left of after the last call. This version works with multiple file
choosers.
char *getImage() {
static char *filename = 0L;
const char *newfile = fl_file_chooser("bla", "*.jpg", filename);
if (newfile) {
if (!filename)
filename = (char*)calloc(FL_PATH_MAX, 1);
strncpy(filename, newfile, FL_PATH_MAX);
/* loadSomeImage(filename); */
}
return newfile;
}
----
http://robowerk.com/
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk