
@c %start of fragment

@deftp Class <gtk-file-selection>
Derives from @code{<gtk-dialog>}.

This class defines the following properties:

@table @code
@item show-fileops
Whether buttons for creating/manipulating files should be displayed

@item filename
The currently selected filename

@item select-multiple
Whether to allow multiple files to be selected

@end table

@end deftp

@deffn Function gtk-file-selection-new  (title@tie{}@code{mchars}) @result{}@tie{} (ret@tie{}@code{<gtk-widget>})
Creates a new file selection dialog box. By default it will contain a
@code{<gtk-tree-view>} of the application's current working directory, and a
file listing. Operation buttons that allow the user to create a directory,
delete files and rename files, are also present.

@table @var
@item title
a message that will be placed in the file requestor's titlebar.

@item ret
the new file selection.

@end table

@end deffn

@deffn Function gtk-file-selection-set-filename  (self@tie{}@code{<gtk-file-selection>}) (filename@tie{}@code{mchars})
@deffnx Method set-filename
Sets a default path for the file requestor. If @var{filename} includes a
directory path, then the requestor will open with that path as its current
working directory.

This has the consequence that in order to open the requestor with a working
directory and an empty filename, @var{filename} must have a trailing directory
separator.

The encoding of @var{filename} is preferred GLib file name encoding, which may
not be UTF-8. See @code{g-filename-from-utf8}.

@table @var
@item filesel
a @code{<gtk-file-selection>}.

@item filename
a string to set as the default file name.

@end table

@end deffn

@deffn Function gtk-file-selection-get-filename  (self@tie{}@code{<gtk-file-selection>}) @result{}@tie{} (ret@tie{}@code{mchars})
@deffnx Method get-filename
This function returns the selected filename in the GLib file name encoding. To
convert to UTF-8, call @code{g-filename-to-utf8}. The returned string points to
a statically allocated buffer and should be copied if you plan to keep it
around.

If no file is selected then the selected directory path is returned.

@table @var
@item filesel
a @code{<gtk-file-selection>}

@item ret
currently-selected filename in the on-disk encoding.

@end table

@end deffn

@deffn Function gtk-file-selection-complete  (self@tie{}@code{<gtk-file-selection>}) (pattern@tie{}@code{mchars})
@deffnx Method complete
Will attempt to match @var{pattern} to a valid filenames or subdirectories in
the current directory. If a match can be made, the matched filename will appear
in the text entry field of the file selection dialog. If a partial match can be
made, the "Files" list will contain those file names which have been partially
matched, and the "Folders" list those directories which have been partially
matched.

@table @var
@item filesel
a @code{<gtk-file-selection>}.

@item pattern
a string of characters which may or may not match any filenames in the current
directory.

@end table

@end deffn


@c %end of fragment
