gtk -> GtkFileSelection

This is a discussion on gtk -> GtkFileSelection within the Linux Programming forums, part of the Platform Specific Boards category; when using the GtkFileSelection dialog, is it possible to stop the user from being able to choose directories, and only ...

  1. #1
    unregistered
    Guest

    Question gtk -> GtkFileSelection

    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

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    202
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. small -> big -> bigger -> bigger than bigger -> ?
    By happyclown in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-11-2009, 12:12 PM
  2. Replies: 1
    Last Post: 09-22-2008, 04:49 AM
  3. Dev-C++ -> Tools - > Editor -> Syntax
    By Yuri2 in forum C++ Programming
    Replies: 19
    Last Post: 07-03-2006, 07:48 AM
  4. > > > Urgent Help < < <
    By CodeCypher in forum C Programming
    Replies: 2
    Last Post: 01-31-2006, 01:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21