pub struct FileChooser { /* private fields */ }Expand description
FileChooser is an interface that can be implemented by file
selection widgets. In GTK+, the main objects that implement this
interface are FileChooserWidget, FileChooserDialog, and
FileChooserButton. You do not need to write an object that
implements the FileChooser interface unless you are trying to
adapt an existing file selector to expose a standard programming
interface.
FileChooser allows for shortcuts to various places in the filesystem.
In the default implementation these are displayed in the left pane. It
may be a bit confusing at first that these shortcuts come from various
sources and in various flavours, so lets explain the terminology here:
-
Bookmarks: are created by the user, by dragging folders from the right pane to the left pane, or by using the “Add”. Bookmarks can be renamed and deleted by the user.
-
Shortcuts: can be provided by the application. For example, a Paint program may want to add a shortcut for a Clipart folder. Shortcuts cannot be modified by the user.
-
Volumes: are provided by the underlying filesystem abstraction. They are the “roots” of the filesystem.
§File Names and Encodings
When the user is finished selecting files in a
FileChooser, your program can get the selected names
either as filenames or as URIs. For URIs, the normal escaping
rules are applied if the URI contains non-ASCII characters.
However, filenames are always returned in
the character set specified by the
G_FILENAME_ENCODING environment variable.
Please see the GLib documentation for more details about this
variable.
This means that while you can pass the result of
FileChooserExt::filename() to g_open() or g_fopen(),
you may not be able to directly set it as the text of a
Label widget unless you convert it first to UTF-8,
which all GTK+ widgets expect. You should use g_filename_to_utf8()
to convert filenames into strings that can be passed to GTK+
widgets.
§Adding a Preview Widget
You can add a custom preview widget to a file chooser and then
get notification about when the preview needs to be updated.
To install a preview widget, use
FileChooserExt::set_preview_widget(). Then, connect to the
update-preview signal to get notified when
you need to update the contents of the preview.
Your callback should use
FileChooserExt::preview_filename() to see what needs
previewing. Once you have generated the preview for the
corresponding file, you must call
FileChooserExt::set_preview_widget_active() with a boolean
flag that indicates whether your callback could successfully
generate a preview.
§Example: Using a Preview Widget ## {gtkfilechooser-preview}
⚠️ The following code is in C ⚠️
{
GtkImage *preview;
...
preview = gtk_image_new ();
gtk_file_chooser_set_preview_widget (my_file_chooser, preview);
g_signal_connect (my_file_chooser, "update-preview",
G_CALLBACK (update_preview_cb), preview);
}
static void
update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
{
GtkWidget *preview;
char *filename;
GdkPixbuf *pixbuf;
gboolean have_preview;
preview = GTK_WIDGET (data);
filename = gtk_file_chooser_get_preview_filename (file_chooser);
pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL);
have_preview = (pixbuf != NULL);
g_free (filename);
gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
if (pixbuf)
g_object_unref (pixbuf);
gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
}§Adding Extra Widgets
You can add extra widgets to a file chooser to provide options
that are not present in the default design. For example, you
can add a toggle button to give the user the option to open a
file in read-only mode. You can use
FileChooserExt::set_extra_widget() to insert additional
widgets in a file chooser.
An example for adding extra widgets:
⚠️ The following code is in C ⚠️
GtkWidget *toggle;
...
toggle = gtk_check_button_new_with_label ("Open file read-only");
gtk_widget_show (toggle);
gtk_file_chooser_set_extra_widget (my_file_chooser, toggle);
}If you want to set more than one extra widget in the file
chooser, you can a container such as a Box or a Grid
and include your widgets in it. Then, set the container as
the whole extra widget.
§Properties
§action
Readable | Writeable
§create-folders
Whether a file chooser not in FileChooserAction::Open mode
will offer the user to create new folders.
Readable | Writeable
§do-overwrite-confirmation
Whether a file chooser in FileChooserAction::Save mode
will present an overwrite confirmation dialog if the user
selects a file name that already exists.
Readable | Writeable
§extra-widget
Readable | Writeable
§filter
Readable | Writeable
§local-only
Readable | Writeable
§preview-widget
Readable | Writeable
§preview-widget-active
Readable | Writeable
§select-multiple
Readable | Writeable
§show-hidden
Readable | Writeable
§use-preview-label
Readable | Writeable
§Signals
§confirm-overwrite
This signal gets emitted whenever it is appropriate to present a
confirmation dialog when the user has selected a file name that
already exists. The signal only gets emitted when the file
chooser is in FileChooserAction::Save mode.
Most applications just need to turn on the
do-overwrite-confirmation property (or call the
FileChooserExt::set_do_overwrite_confirmation() function), and
they will automatically get a stock confirmation dialog.
Applications which need to customize this behavior should do
that, and also connect to the confirm-overwrite
signal.
A signal handler for this signal must return a
FileChooserConfirmation value, which indicates the action to
take. If the handler determines that the user wants to select a
different filename, it should return
FileChooserConfirmation::SelectAgain. If it determines
that the user is satisfied with his choice of file name, it
should return FileChooserConfirmation::AcceptFilename.
On the other hand, if it determines that the stock confirmation
dialog should be used, it should return
FileChooserConfirmation::Confirm. The following example
illustrates this.
§Custom confirmation ## {gtkfilechooser-confirmation}
⚠️ The following code is in C ⚠️
static GtkFileChooserConfirmation
confirm_overwrite_callback (GtkFileChooser *chooser, gpointer data)
{
char *uri;
uri = gtk_file_chooser_get_uri (chooser);
if (is_uri_read_only (uri))
{
if (user_wants_to_replace_read_only_file (uri))
return GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME;
else
return GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN;
} else
return GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM; // fall back to the default dialog
}
...
chooser = gtk_file_chooser_dialog_new (...);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
g_signal_connect (chooser, "confirm-overwrite",
G_CALLBACK (confirm_overwrite_callback), NULL);
if (gtk_dialog_run (chooser) == GTK_RESPONSE_ACCEPT)
save_to_file (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
gtk_widget_destroy (chooser);§current-folder-changed
This signal is emitted when the current folder in a FileChooser
changes. This can happen due to the user performing some action that
changes folders, such as selecting a bookmark or visiting a folder on the
file list. It can also happen as a result of calling a function to
explicitly change the current folder in a file chooser.
Normally you do not need to connect to this signal, unless you need to keep track of which folder a file chooser is showing.
See also: FileChooserExt::set_current_folder(),
FileChooserExt::current_folder(),
FileChooserExt::set_current_folder_uri(),
FileChooserExt::current_folder_uri().
§file-activated
This signal is emitted when the user “activates” a file in the file
chooser. This can happen by double-clicking on a file in the file list, or
by pressing Enter.
Normally you do not need to connect to this signal. It is used internally
by FileChooserDialog to know when to activate the default button in the
dialog.
See also: FileChooserExt::filename(),
FileChooserExt::filenames(), FileChooserExt::uri(),
FileChooserExt::uris().
§selection-changed
This signal is emitted when there is a change in the set of selected files
in a FileChooser. This can happen when the user modifies the selection
with the mouse or the keyboard, or when explicitly calling functions to
change the selection.
Normally you do not need to connect to this signal, as it is easier to wait for the file chooser to finish running, and then to get the list of selected files using the functions mentioned below.
See also: FileChooserExt::select_filename(),
FileChooserExt::unselect_filename(), FileChooserExt::filename(),
FileChooserExt::filenames(), FileChooserExt::select_uri(),
FileChooserExt::unselect_uri(), FileChooserExt::uri(),
FileChooserExt::uris().
§update-preview
This signal is emitted when the preview in a file chooser should be regenerated. For example, this can happen when the currently selected file changes. You should use this signal if you want your file chooser to have a preview widget.
Once you have installed a preview widget with
FileChooserExt::set_preview_widget(), you should update it when this
signal is emitted. You can use the functions
FileChooserExt::preview_filename() or
FileChooserExt::preview_uri() to get the name of the file to preview.
Your widget may not be able to preview all kinds of files; your callback
must call FileChooserExt::set_preview_widget_active() to inform the file
chooser about whether the preview was generated successfully or not.
Please see the example code in [Using a Preview Widget][gtkfilechooser-preview].
See also: FileChooserExt::set_preview_widget(),
FileChooserExt::set_preview_widget_active(),
FileChooserExt::set_use_preview_label(),
FileChooserExt::preview_filename(),
FileChooserExt::preview_uri().
§Implements
Implementations§
Source§impl FileChooser
impl FileChooser
pub const NONE: Option<&'static FileChooser> = None
Trait Implementations§
Source§impl Clone for FileChooser
impl Clone for FileChooser
Source§impl Debug for FileChooser
impl Debug for FileChooser
Source§impl Display for FileChooser
impl Display for FileChooser
impl Eq for FileChooser
Source§impl HasParamSpec for FileChooser
impl HasParamSpec for FileChooser
type ParamSpec = ParamSpecObject
Source§type SetValue = FileChooser
type SetValue = FileChooser
type BuilderFn = fn(&str) -> ParamSpecObjectBuilder<'_, FileChooser>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for FileChooser
impl Hash for FileChooser
impl IsA<FileChooser> for FileChooserButton
impl IsA<FileChooser> for FileChooserDialog
impl IsA<FileChooser> for FileChooserNative
impl IsA<FileChooser> for FileChooserWidget
Source§impl Ord for FileChooser
impl Ord for FileChooser
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<OT: ObjectType> PartialEq<OT> for FileChooser
impl<OT: ObjectType> PartialEq<OT> for FileChooser
Source§impl<OT: ObjectType> PartialOrd<OT> for FileChooser
impl<OT: ObjectType> PartialOrd<OT> for FileChooser
Source§impl StaticType for FileChooser
impl StaticType for FileChooser
Source§fn static_type() -> Type
fn static_type() -> Type
Self.Auto Trait Implementations§
impl !Send for FileChooser
impl !Sync for FileChooser
impl Freeze for FileChooser
impl RefUnwindSafe for FileChooser
impl Unpin for FileChooser
impl UnsafeUnpin for FileChooser
impl UnwindSafe for FileChooser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Cast for Twhere
T: ObjectType,
impl<T> Cast for Twhere
T: ObjectType,
Source§fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast<T>(self) -> Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
fn upcast_ref<T>(&self) -> &Twhere
T: ObjectType,
Self: IsA<T>,
T. Read moreSource§fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast<T>(self) -> Result<T, Self>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
fn downcast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
Self: MayDowncastTo<T>,
T. Read moreSource§fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
fn dynamic_cast<T>(self) -> Result<T, Self>where
T: ObjectType,
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while upcast will do many checks at compile-time already. downcast will
perform the same checks at runtime as dynamic_cast, but will also ensure some amount of
compile-time safety. Read moreSource§fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
fn dynamic_cast_ref<T>(&self) -> Option<&T>where
T: ObjectType,
T. This handles upcasting, downcasting
and casting between interface and interface implementors. All checks are performed at
runtime, while downcast and upcast will do many checks at compile-time already. Read moreSource§unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
unsafe fn unsafe_cast<T>(self) -> Twhere
T: ObjectType,
T unconditionally. Read moreSource§unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
unsafe fn unsafe_cast_ref<T>(&self) -> &Twhere
T: ObjectType,
&T unconditionally. Read moreSource§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<O> FileChooserExt for Owhere
O: IsA<FileChooser>,
impl<O> FileChooserExt for Owhere
O: IsA<FileChooser>,
Source§fn add_filter(&self, filter: FileFilter)
fn add_filter(&self, filter: FileFilter)
filter to the list of filters that the user can select between.
When a filter is selected, only files that are passed by that
filter are displayed. Read moreSource§fn add_shortcut_folder(&self, folder: impl AsRef<Path>) -> Result<(), Error>
fn add_shortcut_folder(&self, folder: impl AsRef<Path>) -> Result<(), Error>
Source§fn add_shortcut_folder_uri(&self, uri: &str) -> Result<(), Error>
fn add_shortcut_folder_uri(&self, uri: &str) -> Result<(), Error>
Source§fn action(&self) -> FileChooserAction
fn action(&self) -> FileChooserAction
set_action(). Read moreSource§fn choice(&self, id: &str) -> Option<GString>
fn choice(&self, id: &str) -> Option<GString>
Source§fn creates_folders(&self) -> bool
fn creates_folders(&self) -> bool
set_create_folders(). Read moreSource§fn current_folder(&self) -> Option<PathBuf>
fn current_folder(&self) -> Option<PathBuf>
Source§fn current_folder_file(&self) -> Option<File>
fn current_folder_file(&self) -> Option<File>
Source§fn current_folder_uri(&self) -> Option<GString>
fn current_folder_uri(&self) -> Option<GString>
Source§fn current_name(&self) -> Option<GString>
fn current_name(&self) -> Option<GString>
Source§fn does_overwrite_confirmation(&self) -> bool
fn does_overwrite_confirmation(&self) -> bool
Source§fn extra_widget(&self) -> Option<Widget>
fn extra_widget(&self) -> Option<Widget>
set_extra_widget(). Read moreSource§fn filename(&self) -> Option<PathBuf>
fn filename(&self) -> Option<PathBuf>
Source§fn filter(&self) -> Option<FileFilter>
fn filter(&self) -> Option<FileFilter>
set_filter(). Read moreSource§fn is_local_only(&self) -> bool
fn is_local_only(&self) -> bool
set_local_only() Read moreSource§fn preview_file(&self) -> Option<File>
fn preview_file(&self) -> Option<File>
gio::File that should be previewed in a custom preview
Internal function, see preview_uri(). Read moreSource§fn preview_filename(&self) -> Option<PathBuf>
fn preview_filename(&self) -> Option<PathBuf>
set_preview_widget(). Read moreSource§fn preview_uri(&self) -> Option<GString>
fn preview_uri(&self) -> Option<GString>
set_preview_widget(). Read moreSource§fn preview_widget(&self) -> Option<Widget>
fn preview_widget(&self) -> Option<Widget>
set_preview_widget(). Read moreSource§fn is_preview_widget_active(&self) -> bool
fn is_preview_widget_active(&self) -> bool
set_preview_widget()
should be shown for the current filename. See
set_preview_widget_active(). Read moreSource§fn selects_multiple(&self) -> bool
fn selects_multiple(&self) -> bool
set_select_multiple(). Read moreset_show_hidden(). Read moreSource§fn uri(&self) -> Option<GString>
fn uri(&self) -> Option<GString>
Source§fn uris(&self) -> Vec<GString>
fn uris(&self) -> Vec<GString>
self. The returned names are full absolute URIs. Read moreSource§fn uses_preview_label(&self) -> bool
fn uses_preview_label(&self) -> bool
set_use_preview_label(). Read moreSource§fn list_filters(&self) -> Vec<FileFilter>
fn list_filters(&self) -> Vec<FileFilter>
Source§fn list_shortcut_folder_uris(&self) -> Vec<GString>
fn list_shortcut_folder_uris(&self) -> Vec<GString>
add_shortcut_folder_uri(). Read moreSource§fn list_shortcut_folders(&self) -> Vec<PathBuf>
fn list_shortcut_folders(&self) -> Vec<PathBuf>
add_shortcut_folder(). Read moreSource§fn remove_choice(&self, id: &str)
fn remove_choice(&self, id: &str)
FileChooserExtManual::add_choice()][crate::prelude::FileChooserExtManual::add_choice()]. Read moreSource§fn remove_filter(&self, filter: &FileFilter)
fn remove_filter(&self, filter: &FileFilter)
filter from the list of filters that the user can select between. Read moreSource§fn remove_shortcut_folder(&self, folder: impl AsRef<Path>) -> Result<(), Error>
fn remove_shortcut_folder(&self, folder: impl AsRef<Path>) -> Result<(), Error>
Source§fn remove_shortcut_folder_uri(&self, uri: &str) -> Result<(), Error>
fn remove_shortcut_folder_uri(&self, uri: &str) -> Result<(), Error>
Source§fn select_all(&self)
fn select_all(&self)
Source§fn select_file(&self, file: &impl IsA<File>) -> Result<(), Error>
fn select_file(&self, file: &impl IsA<File>) -> Result<(), Error>
file. An internal function. See
_gtk_file_chooser_select_uri(). Read moreSource§fn select_filename(&self, filename: impl AsRef<Path>) -> bool
fn select_filename(&self, filename: impl AsRef<Path>) -> bool
self, then the current folder of self will
be changed to the folder containing filename. Read moreSource§fn select_uri(&self, uri: &str) -> bool
fn select_uri(&self, uri: &str) -> bool
uri. If the URI doesn’t refer to a
file in the current folder of self, then the current folder of
self will be changed to the folder containing filename. Read moreSource§fn set_action(&self, action: FileChooserAction)
fn set_action(&self, action: FileChooserAction)
FileChooserAction::Save but not if the action is
FileChooserAction::Open. Read moreSource§fn set_choice(&self, id: &str, option: &str)
fn set_choice(&self, id: &str, option: &str)
FileChooserExtManual::add_choice()][crate::prelude::FileChooserExtManual::add_choice()]. For a boolean choice, the
possible options are “true” and “false”. Read moreSource§fn set_create_folders(&self, create_folders: bool)
fn set_create_folders(&self, create_folders: bool)
FileChooserAction::Open. Read moreSource§fn set_current_folder(&self, filename: impl AsRef<Path>) -> bool
fn set_current_folder(&self, filename: impl AsRef<Path>) -> bool
self from a local filename.
The user will be shown the full contents of the current folder,
plus user interface elements for navigating to other folders. Read moreSource§fn set_current_folder_file(&self, file: &impl IsA<File>) -> Result<(), Error>
fn set_current_folder_file(&self, file: &impl IsA<File>) -> Result<(), Error>
self from a gio::File.
Internal function, see set_current_folder_uri(). Read moreSource§fn set_current_folder_uri(&self, uri: &str) -> bool
fn set_current_folder_uri(&self, uri: &str) -> bool
self from an URI.
The user will be shown the full contents of the current folder,
plus user interface elements for navigating to other folders. Read moreSource§fn set_current_name(&self, name: &str)
fn set_current_name(&self, name: &str)
name. Read moreSource§fn set_do_overwrite_confirmation(&self, do_overwrite_confirmation: bool)
fn set_do_overwrite_confirmation(&self, do_overwrite_confirmation: bool)
FileChooserAction::Save mode will present
a confirmation dialog if the user types a file name that already exists. This
is false by default. Read moreSource§fn set_extra_widget(&self, extra_widget: &impl IsA<Widget>)
fn set_extra_widget(&self, extra_widget: &impl IsA<Widget>)
Source§fn set_file(&self, file: &impl IsA<File>) -> Result<(), Error>
fn set_file(&self, file: &impl IsA<File>) -> Result<(), Error>
file as the current filename for the file chooser, by changing
to the file’s parent folder and actually selecting the file in list. If
the self is in FileChooserAction::Save mode, the file’s base name
will also appear in the dialog’s file name entry. Read moreSource§fn set_filename(&self, filename: impl AsRef<Path>) -> bool
fn set_filename(&self, filename: impl AsRef<Path>) -> bool
filename as the current filename for the file chooser, by changing to
the file’s parent folder and actually selecting the file in list; all other
files will be unselected. If the self is in
FileChooserAction::Save mode, the file’s base name will also appear in
the dialog’s file name entry. Read moreSource§fn set_filter(&self, filter: &FileFilter)
fn set_filter(&self, filter: &FileFilter)
Source§fn set_local_only(&self, local_only: bool)
fn set_local_only(&self, local_only: bool)
local_only is true (the default),
then the selected file or files are guaranteed to be
accessible through the operating systems native file
system and therefore the application only
needs to worry about the filename functions in
FileChooser, like filename(),
rather than the URI functions like
uri(), Read moreSource§fn set_preview_widget(&self, preview_widget: &impl IsA<Widget>)
fn set_preview_widget(&self, preview_widget: &impl IsA<Widget>)
update-preview
signal, and call preview_filename() or
preview_uri() on each change. If you can
display a preview of the new file, update your widget and
set the preview active using set_preview_widget_active().
Otherwise, set the preview inactive. Read moreSource§fn set_preview_widget_active(&self, active: bool)
fn set_preview_widget_active(&self, active: bool)
set_preview_widget() should be shown for the
current filename. When active is set to false, the file chooser
may display an internally generated preview of the current file
or it may display no preview at all. See
set_preview_widget() for more details. Read moreSource§fn set_select_multiple(&self, select_multiple: bool)
fn set_select_multiple(&self, select_multiple: bool)
FileChooserAction::Open or
FileChooserAction::SelectFolder. Read moreSource§fn set_uri(&self, uri: &str) -> bool
fn set_uri(&self, uri: &str) -> bool
uri as the current file for the file chooser,
by changing to the URI’s parent folder and actually selecting the URI in the
list. If the self is FileChooserAction::Save mode, the URI’s base
name will also appear in the dialog’s file name entry. Read moreSource§fn set_use_preview_label(&self, use_label: bool)
fn set_use_preview_label(&self, use_label: bool)
Source§fn unselect_all(&self)
fn unselect_all(&self)
Source§fn unselect_file(&self, file: &impl IsA<File>)
fn unselect_file(&self, file: &impl IsA<File>)
file. If the file is not in the current
directory, does not exist, or is otherwise not currently selected, does nothing. Read moreSource§fn unselect_filename(&self, filename: impl AsRef<Path>)
fn unselect_filename(&self, filename: impl AsRef<Path>)
Source§fn unselect_uri(&self, uri: &str)
fn unselect_uri(&self, uri: &str)
uri. If the file
is not in the current directory, does not exist, or
is otherwise not currently selected, does nothing. Read moreSource§fn connect_confirm_overwrite<F: Fn(&Self) -> FileChooserConfirmation + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_confirm_overwrite<F: Fn(&Self) -> FileChooserConfirmation + 'static>( &self, f: F, ) -> SignalHandlerId
FileChooserAction::Save mode. Read moreSource§fn connect_current_folder_changed<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_current_folder_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
FileChooser
changes. This can happen due to the user performing some action that
changes folders, such as selecting a bookmark or visiting a folder on the
file list. It can also happen as a result of calling a function to
explicitly change the current folder in a file chooser. Read moreSource§fn connect_file_activated<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_file_activated<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Enter. Read moreSource§fn connect_selection_changed<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_selection_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
FileChooser. This can happen when the user modifies the selection
with the mouse or the keyboard, or when explicitly calling functions to
change the selection. Read moreSource§fn connect_update_preview<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_update_preview<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_action_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_create_folders_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_do_overwrite_confirmation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_extra_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_filter_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_local_only_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_preview_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_preview_widget_active_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_select_multiple_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_use_preview_label_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
impl<O> FileChooserExtManual for Owhere
O: IsA<FileChooser>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>
Source§impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere
T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,
unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>
unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>
impl<'a, T, C, E> FromValueOptional<'a> for Twhere
T: FromValue<'a, Checker = C>,
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>,
E: Error + Send + 'static,
Source§impl<T> IntoClosureReturnValue for T
impl<T> IntoClosureReturnValue for T
fn into_closure_return_value(self) -> Option<Value>
impl<Super, Sub> MayDowncastTo<Sub> for Super
Source§impl<T> ObjectExt for Twhere
T: ObjectType,
impl<T> ObjectExt for Twhere
T: ObjectType,
Source§fn is<U>(&self) -> boolwhere
U: StaticType,
fn is<U>(&self) -> boolwhere
U: StaticType,
true if the object is an instance of (can be cast to) T.Source§fn object_class(&self) -> &Class<Object>
fn object_class(&self) -> &Class<Object>
ObjectClass of the object. Read moreSource§fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
fn class_of<U>(&self) -> Option<&Class<U>>where
U: IsClass,
T. Read moreSource§fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
fn interface<U>(&self) -> Option<InterfaceRef<'_, U>>where
U: IsInterface,
T of the object. Read moreSource§fn set_property_from_value(&self, property_name: &str, value: &Value)
fn set_property_from_value(&self, property_name: &str, value: &Value)
Source§fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
fn set_properties(&self, property_values: &[(&str, &dyn ToValue)])
Source§fn set_properties_from_value(&self, property_values: &[(&str, Value)])
fn set_properties_from_value(&self, property_values: &[(&str, Value)])
Source§fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
fn property<V>(&self, property_name: &str) -> Vwhere
V: for<'b> FromValue<'b> + 'static,
property_name of the object and cast it to the type V. Read moreSource§fn property_value(&self, property_name: &str) -> Value
fn property_value(&self, property_name: &str) -> Value
property_name of the object. Read moreSource§fn property_type(&self, property_name: &str) -> Option<Type>
fn property_type(&self, property_name: &str) -> Option<Type>
property_name of this object. Read moreSource§fn find_property(&self, property_name: &str) -> Option<ParamSpec>
fn find_property(&self, property_name: &str) -> Option<ParamSpec>
ParamSpec of the property property_name of this object.Source§fn list_properties(&self) -> PtrSlice<ParamSpec>
fn list_properties(&self) -> PtrSlice<ParamSpec>
ParamSpec of the properties of this object.Source§fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
fn freeze_notify(&self) -> PropertyNotificationFreezeGuard
Source§unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
unsafe fn set_qdata<QD>(&self, key: Quark, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn qdata<QD>(&self, key: Quark) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
unsafe fn steal_qdata<QD>(&self, key: Quark) -> Option<QD>where
QD: 'static,
key. Read moreSource§unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
unsafe fn set_data<QD>(&self, key: &str, value: QD)where
QD: 'static,
key. Read moreSource§unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
unsafe fn data<QD>(&self, key: &str) -> Option<NonNull<QD>>where
QD: 'static,
key. Read moreSource§unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
unsafe fn steal_data<QD>(&self, key: &str) -> Option<QD>where
QD: 'static,
key. Read moreSource§fn block_signal(&self, handler_id: &SignalHandlerId)
fn block_signal(&self, handler_id: &SignalHandlerId)
Source§fn unblock_signal(&self, handler_id: &SignalHandlerId)
fn unblock_signal(&self, handler_id: &SignalHandlerId)
Source§fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
fn stop_signal_emission(&self, signal_id: SignalId, detail: Option<Quark>)
Source§fn stop_signal_emission_by_name(&self, signal_name: &str)
fn stop_signal_emission_by_name(&self, signal_name: &str)
Source§fn connect<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_local<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_local_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
fn connect_local_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§unsafe fn connect_unsafe<F>(
&self,
signal_name: &str,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe<F>( &self, signal_name: &str, after: bool, callback: F, ) -> SignalHandlerId
signal_name on this object. Read moreSource§unsafe fn connect_unsafe_id<F>(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
callback: F,
) -> SignalHandlerId
unsafe fn connect_unsafe_id<F>( &self, signal_id: SignalId, details: Option<Quark>, after: bool, callback: F, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn connect_closure(
&self,
signal_name: &str,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure( &self, signal_name: &str, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_name on this object. Read moreSource§fn connect_closure_id(
&self,
signal_id: SignalId,
details: Option<Quark>,
after: bool,
closure: RustClosure,
) -> SignalHandlerId
fn connect_closure_id( &self, signal_id: SignalId, details: Option<Quark>, after: bool, closure: RustClosure, ) -> SignalHandlerId
signal_id on this object. Read moreSource§fn watch_closure(&self, closure: &impl AsRef<Closure>)
fn watch_closure(&self, closure: &impl AsRef<Closure>)
closure to the lifetime of the object. When
the object’s reference count drops to zero, the closure will be
invalidated. An invalidated closure will ignore any calls to
invoke_with_values, or
invoke when using Rust closures.Source§fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit<R>(&self, signal_id: SignalId, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
fn emit_with_values(&self, signal_id: SignalId, args: &[Value]) -> Option<Value>
Self::emit but takes Value for the arguments.Source§fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name<R>(&self, signal_name: &str, args: &[&dyn ToValue]) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_values(
&self,
signal_name: &str,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_values( &self, signal_name: &str, args: &[Value], ) -> Option<Value>
Source§fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_by_name_with_details<R>(
&self,
signal_name: &str,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_by_name_with_details_and_values(
&self,
signal_name: &str,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_by_name_with_details_and_values( &self, signal_name: &str, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
fn emit_with_details<R>(
&self,
signal_id: SignalId,
details: Quark,
args: &[&dyn ToValue],
) -> Rwhere
R: TryFromClosureReturnValue,
Source§fn emit_with_details_and_values(
&self,
signal_id: SignalId,
details: Quark,
args: &[Value],
) -> Option<Value>
fn emit_with_details_and_values( &self, signal_id: SignalId, details: Quark, args: &[Value], ) -> Option<Value>
Source§fn disconnect(&self, handler_id: SignalHandlerId)
fn disconnect(&self, handler_id: SignalHandlerId)
Source§fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
fn connect_notify_local<F>(&self, name: Option<&str>, f: F) -> SignalHandlerId
notify signal of the object. Read moreSource§unsafe fn connect_notify_unsafe<F>(
&self,
name: Option<&str>,
f: F,
) -> SignalHandlerId
unsafe fn connect_notify_unsafe<F>( &self, name: Option<&str>, f: F, ) -> SignalHandlerId
notify signal of the object. Read more