gtkfilechooser can be used in two modes, to select a single file at a time or to select a set of more than one file. to set this, use gtk_file_chooser_set_select_multiple(). in single-selection mode, you can use gtk_file_chooser_get_filename() to get a file name from the local file system or gtk_file_chooser_get_uri() to get a full-formed uri. in multiple-selection mode, you can use gtk_file_chooser_get_filenames() to get a gslist of filename strings, or gtk_file_chooser_get_uris() to get a list of uri strings. also, you can configure gtkfilechooser to select files or folders. consider a backup program that needs to let the user select a folder that will be backed up along with its subfolders. to configure whether gtkfilechooser is used to select files or folders, use gtk_file_chooser_set_action(). in addition, this lets you configure whether the file chooser will be used to select existing files or folders (e.g. for "file/open"), or to type in new filenames (for "file/save as..."). |