The #GtkFileChooserButton is a widget that lets the user select a
file. It implements the #GtkFileChooser interface. Visually, it is a
file name with a button to bring up a #GtkFileChooserDialog.
The user can then use that dialog to change the file associated with
that button. This widget does not support setting the
#GtkFileChooser:select-multiple property to true.
GtkFileChooserButton has a CSS node with name “filechooserbutton”, containing
a subnode for the internal button with name “button” and style class “.file”.
The #GtkFileChooserButton is a widget that lets the user select a file. It implements the #GtkFileChooser interface. Visually, it is a file name with a button to bring up a #GtkFileChooserDialog. The user can then use that dialog to change the file associated with that button. This widget does not support setting the #GtkFileChooser:select-multiple property to true.
Create a button to let the user select a file in /etc
{ GtkWidget *button; button = gtk_file_chooser_button_new (_("Select a file"), GTK_FILE_CHOOSER_ACTION_OPEN); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button), "/etc"); }The #GtkFileChooserButton supports the #GtkFileChooserActions gtk.types.FileChooserAction.Open and gtk.types.FileChooserAction.SelectFolder.
> The #GtkFileChooserButton will ellipsize the label, and will thus > request little horizontal space. To give the button more space, > you should call gtk.widget.Widget.getPreferredSize, > gtk.file_chooser_button.FileChooserButton.setWidthChars, or pack the button in > such a way that other interface elements give space to the > widget.
CSS nodes
GtkFileChooserButton has a CSS node with name “filechooserbutton”, containing a subnode for the internal button with name “button” and style class “.file”.