GtkFileChooserDialog
GtkFileChooserDialog — A file chooser dialog, suitable for “File/Open” or “File/Save” commands
|
 |
Includes
#include <gtk/gtk.h>
Description
GtkFileChooserDialog is a dialog box suitable for use with
“File/Open” or “File/Save as” commands. This widget works by
putting a GtkFileChooserWidget inside a GtkDialog. It exposes
the GtkFileChooser interface, so you can use all of the
GtkFileChooser functions on the file chooser dialog as well as
those for GtkDialog.
Note that GtkFileChooserDialog does not have any methods of its
own. Instead, you should use the functions that work on a
GtkFileChooser.
If you want to integrate well with the platform you should use the
GtkFileChooserNative API, which will use a platform-specific
dialog if available and fall back to GtkFileChooserDialog
otherwise.
Typical usage
In the simplest of cases, you can the following code to use
GtkFileChooserDialog to select a file for opening:
To use a dialog for saving, you can use this:
Setting up a file chooser dialog
There are various cases in which you may need to use a GtkFileChooserDialog:
Note that old versions of the file chooser’s documentation suggested
using gtk_file_chooser_set_current_folder() in various
situations, with the intention of letting the application
suggest a reasonable default folder. This is no longer
considered to be a good policy, as now the file chooser is
able to make good suggestions on its own. In general, you
should only cause the file chooser to show a specific folder
when it is appropriate to use gtk_file_chooser_set_filename(),
i.e. when you are doing a Save As command and you already
have a file saved somewhere.
Types and Values
struct GtkFileChooserDialog
struct GtkFileChooserDialog;