[Insight-users] FLTK: fl_file_chooser ??

Charl P. Botha c . p . botha at ewi . tudelft . nl
07 Aug 2003 17:57:07 +0200


On Thu, 2003-08-07 at 17:50, salah wrote:
>   char *fName_Image = fl_file_chooser("Choose Input Image File", "*.mh*", "d:/data/");
>    char *fName_Seg =   fl_file_chooser("Choose Segmented Image File", "*.mh*", "d:/data/");
>    char *fName_Bone =  fl_file_chooser("Choose Bone Image File", "*.mh*", "d:/data/");
> 
> when the program runs, the file chooser window appear three times 
> I choose three different files. The strange thing is that all the three 
> variable ( fName_Image, fName_Seg, and fName_Bone) finally 
> have the same value, which is the name of the last chosen file!!

This is the expected behaviour.  Please read the documentation:
http://www . fltk . org/documentation . php/doc-1 . 1/functions . html#fl_file_chooser2
"The returned value points at a static buffer that is only good until
the next time fl_file_chooser() is called."

-- 
charl p. botha http://cpbotha . net/ http://visualisation . tudelft . nl/