A button to launch a file selection dialog
The <gtk-file-chooser-button> is a widget that lets the user select a
file. It implements the <gtk-file-chooser> interface. Visually, it is a
file name with a button to bring up a <gtk-file-chooser-dialog>. The user
can then use that dialog to change the file associated with that button. This
widget does not support setting the "select-multiple" property to
‘#t’.
{
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 <gtk-file-chooser-button> supports the
<gtk-file-chooser-action>s ‘GTK_FILE_CHOOSER_ACTION_OPEN’ and
‘GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER’.
The <gtk-file-chooser-button> will ellipsize the label, and thus will
thus request little horizontal space. To give the button more space, you should
call gtk-widget-size-request,
gtk-file-chooser-button-set-width-chars, or pack the button in such a way
that other interface elements give space to the widget.
Derives from
<gtk-file-chooser>,<gtk-hbox>.This class defines the following slots:
dialog- The file chooser dialog to use.
focus-on-click- Whether the button grabs focus when it is clicked with the mouse
title- The title of the file chooser dialog.
width-chars- The desired width of the button widget, in characters.
mchars) (action <gtk-file-chooser-action>) ⇒ (ret <gtk-widget>)Creates a new file-selecting button widget.
- title
- the title of the browse dialog.
- action
- the open mode for the widget.
- ret
- a new button widget.
Since 2.6
<gtk-file-chooser-button>) ⇒ (ret mchars)Retrieves the title of the browse dialog used by button. The returned value should not be modified or freed.
- button
- the button widget to examine.
- ret
- a pointer to the browse dialog's title.
Since 2.6