PDA

View Full Version : gtk -> GtkFileSelection



unregistered
01-07-2002, 10:00 PM
when using the GtkFileSelection dialog, is it possible to stop the user from being able to choose directories, and only let them choos files?

thnx

starX
01-09-2002, 03:41 AM
I'm not particularly familiar with GTK, but in other gui environs, I have been able to feed the file selector with only files that pass a certain file-test.

A rough psuedo code would looke something like:

while(list directory)
{
*file = DIRECTORY_LISTING;

if (*file is a dir)
{
file_dialogue = *file;
}
}

You'll probably have to check the permissions of the file for the file-test, just remember that the format for a directory is drwxrwxrwx, rather than -rwxrwxrwx.

Hope this is helpful.

--starX
www.axisoftime.com