K.C. Babb wrote:
>> On 07.12.2009, at 22:18, K.C. Babb wrote:
>>
>>> Is there a way to cause Fl_File_Chooser to sort such that =
>> subdirectories are listed last, rather than first?  Or not at all?  =
>> And/or to list links after regular files?  I don't seem to be able to =
>> get either of these done with a custom sorting routine.  Thanks,
>>
>> Subdirectories end in a '/'. There is no marker for links though. You'd =
>> have to use the routines that your OS provides.
>>
>> Matthias=
>>
> 
> I have tried looking for '/' in a custom sort routine, and via ddd have found 
> that the subdirectory names do not have them at that point.  The sort routine 
> is being called, but the (struct dirent *)->d_name has no slash.

        I'm not sure if this is right, but you probably have to stat()
        the filename to see if it's a dir. Trouble is, that can really
        slow the interface down if there's a lot of files, and the files
        are on a network drive..

        You might consider using the Fl_Native_File_Chooser widget
        which gives you access to the OS's own file browsers which
        will probably do what you want. eg:
        http://seriss.com/people/erco/fltk/Fl_Native_File_Chooser/

        This widget will probably be included in a future version
        of FLTK, since native file browsing capability is often requested.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to