Synopsis#include <gtk/gtk.h> GtkFileChooserButton; GtkWidget* gtk_file_chooser_button_new (const gchar *title, GtkFileChooserAction action); GtkWidget* gtk_file_chooser_button_new_with_backend (const gchar *title, GtkFileChooserAction action, const gchar *backend); GtkWidget* gtk_file_chooser_button_new_with_dialog (GtkWidget *dialog); const gchar* gtk_file_chooser_button_get_title (GtkFileChooserButton *button); void gtk_file_chooser_button_set_title (GtkFileChooserButton *button, const gchar *title); gint gtk_file_chooser_button_get_width_chars (GtkFileChooserButton *button); void gtk_file_chooser_button_set_width_chars (GtkFileChooserButton *button, gint n_chars); gboolean gtk_file_chooser_button_get_focus_on_click (GtkFileChooserButton *button); void gtk_file_chooser_button_set_focus_on_click (GtkFileChooserButton *button, gboolean focus_on_click); Object HierarchyGObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBox +----GtkHBox +----GtkFileChooserButton Implemented InterfacesGtkFileChooserButton implements AtkImplementorIface, GtkBuildable and GtkFileChooser. Properties"dialog" GtkFileChooser* : Write / Construct Only "focus-on-click" gboolean : Read / Write "title" gchar* : Read / Write "width-chars" gint : Read / Write Description
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 "select-multiple"
property to Example 36. 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 Important
The GtkFileChooserButton will ellipsize the label,
and thus will thus request little horizontal space. To give the button
more space, you should call DetailsGtkFileChooserButtontypedef struct _GtkFileChooserButton GtkFileChooserButton; This should not be accessed directly. Use the accessor functions below. gtk_file_chooser_button_new ()GtkWidget* gtk_file_chooser_button_new (const gchar *title, GtkFileChooserAction action); Creates a new file-selecting button widget.
Since 2.6 gtk_file_chooser_button_new_with_backend ()GtkWidget* gtk_file_chooser_button_new_with_backend (const gchar *title, GtkFileChooserAction action, const gchar *backend); Warning
Creates a new file-selecting button widget using
Since 2.6 gtk_file_chooser_button_new_with_dialog ()GtkWidget* gtk_file_chooser_button_new_with_dialog (GtkWidget *dialog);
Creates a GtkFileChooserButton widget which uses
Note that
Also note that the dialog needs to have its confirmative button
added with response
Since 2.6 gtk_file_chooser_button_get_title ()const gchar* gtk_file_chooser_button_get_title (GtkFileChooserButton *button);
Retrieves the title of the browse dialog used by
Since 2.6 gtk_file_chooser_button_set_title ()void gtk_file_chooser_button_set_title (GtkFileChooserButton *button, const gchar *title);
Modifies the
Since 2.6 gtk_file_chooser_button_get_width_chars ()gint gtk_file_chooser_button_get_width_chars (GtkFileChooserButton *button);
Retrieves the width in characters of the
Since 2.6 gtk_file_chooser_button_set_width_chars ()void gtk_file_chooser_button_set_width_chars (GtkFileChooserButton *button, gint n_chars);
Sets the width (in characters) that
Since 2.6 gtk_file_chooser_button_get_focus_on_click ()gboolean gtk_file_chooser_button_get_focus_on_click (GtkFileChooserButton *button);
Returns whether the button grabs focus when it is clicked with the mouse.
See
Since 2.10 gtk_file_chooser_button_set_focus_on_click ()void gtk_file_chooser_button_set_focus_on_click (GtkFileChooserButton *button, gboolean focus_on_click); Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application.
Since 2.10 Property DetailsThe
|
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
Since 2.12