1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 A button to launch a file selection dialog
7 <!-- ##### SECTION Long_Description ##### -->
9 The #GtkFileChooserButton is a widget that lets the user select a
10 file. It implements the #GtkFileChooser interface. Visually, it is a
11 file name with a button to bring up a #GtkFileChooserDialog.
12 The user can then use that dialog to change the file associated with
13 that button. This widget does not support setting the "select-multiple"
18 <title>Create a button to let the user select a file in /etc</title>
23 button = gtk_file_chooser_button_new (_("Select a file"));
24 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (button),
31 The #GtkFileChooserButton supports all four #GtkFileChooserAction<!--
32 -->s that the #GtkFileChooser supports. Two of the actions,
33 %GTK_FILE_CHOOSER_ACTION_SAVE and
34 %GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, give the button the appearance
35 of an entry next to a button. The user can type the name of a file in
36 this entry, and it will complete as it types. The other two actions,
37 %GTK_FILE_CHOOSER_ACTION_OPEN and
38 %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, make the #GtkFileChooserAction
39 look like a #GtkButton.
43 <title>Using GtkFileChooserButton in save mode</title>
48 button = gtk_file_chooser_button_new (_("Save as..."));
49 gtk_file_chooser_set_action (GTK_FILE_CHOOSER (button),
50 GTK_FILE_CHOOSER_ACTION_SAVE);
51 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER_BUTTON (button),
52 DEFAULT_SAVE_DIRECTORY);
59 The #GtkFileChooserButton will ellipsize the label while in Open mode,
60 and thus will thus request little horizontal space. To give the button
61 more space, you should call gtk_widget_size_request(),
62 gtk_file_chooser_button_set_width_chars (), or pack the button in
63 such a way that other interface elements give space to the widget.
67 <!-- ##### SECTION See_Also ##### -->
72 <!-- ##### STRUCT GtkFileChooserButton ##### -->
74 This should not be accessed directly. Use the accessor functions below.
78 <!-- ##### ARG GtkFileChooserButton:active ##### -->
80 %TRUE, if the #GtkFileChooserDialog associated with the button has been
81 made visible. This can also be set by the application, though it is
82 rarely useful to do so.
85 <!-- ##### ARG GtkFileChooserButton:dialog ##### -->
87 Instance of the #GtkFileChooserDialog associated with the button.
90 <!-- ##### ARG GtkFileChooserButton:title ##### -->
92 Title to put on the #GtkFileChooserDialog associated with the button.
95 <!-- ##### ARG GtkFileChooserButton:width-chars ##### -->
97 The width of the entry and label inside the button, in characters.
100 <!-- ##### FUNCTION gtk_file_chooser_button_new ##### -->
109 <!-- ##### FUNCTION gtk_file_chooser_button_new_with_backend ##### -->
119 <!-- ##### FUNCTION gtk_file_chooser_button_new_with_dialog ##### -->
128 <!-- ##### FUNCTION gtk_file_chooser_button_get_title ##### -->
137 <!-- ##### FUNCTION gtk_file_chooser_button_set_title ##### -->
146 <!-- ##### FUNCTION gtk_file_chooser_button_get_active ##### -->
155 <!-- ##### FUNCTION gtk_file_chooser_button_set_active ##### -->
164 <!-- ##### FUNCTION gtk_file_chooser_button_get_width_chars ##### -->
173 <!-- ##### FUNCTION gtk_file_chooser_button_set_width_chars ##### -->