GtkFileChooser, starting with GTK+ 2.4, is the new set of APIs for file selection widgets and dialogs. Previous versions of GTK+ used GtkFileSelection, which has numerous problems. GtkFileChooser is an abstract interface that can be implemented by widgets that perform file selection tasks. Two widgets in GTK+ implement this interface: GtkFileChooserDialog and GtkFileChooserWidget. Most applications simply need to use GtkFileChooserDialog, which is a dialog box that allows the user to select existing files for opening them, or to pick new filenames for saving documents. GtkFileChooserWidget is for special applications that need to embed a file selection widget inside a larger window. In the context of GTK+, GtkFileChooserDialog is simply a GtkDialog box with a GtkFileChooserWidget. inside.
To create a GtkFileChooserDialog, you simply call Please see Example 37, “Typical usage” for how to create a simple file chooser dialog and extract the selected filename from it. |