FileDialog
Object Hierarchy:
Description:
[ CCode ( type_id = "gtk_file_dialog_get_type ()" ) ]
[ Version ( since = "4.10" ) ]
public sealed class FileDialog : Object
[ Version ( since = "4.10" ) ]
public sealed class FileDialog : Object
Asynchronous API to present a file chooser dialog.
`GtkFileDialog` collects the arguments that are needed to present the dialog to the user, such as a title for the dialog and whether it should be modal.
The dialog is shown with [method@Gtk.FileDialog.open], [method@Gtk.FileDialog.save], etc.
Namespace: Gtk
Package: gtk4
Content:
Properties:
- public string accept_label { get; set; }
Label for the file chooser's accept button.
- public FileFilter default_filter { get; set; }
The default filter.
- public ListModel filters { get; set; }
The list of filters.
- public File initial_file { get; set; }
The initial file.
- public File initial_folder { get; set; }
The initial folder.
- public string initial_name { get; set; }
The initial name.
- public bool modal { get; set; }
Whether the file chooser dialog is modal.
- public string title { get; set; }
A title that may be shown on the file chooser dialog.
Creation methods:
- public FileDialog ()
Creates a new `GtkFileDialog` object.
Methods:
- public unowned string? get_accept_label ()
Retrieves the text used by the dialog on its accept button.
- public unowned FileFilter? get_default_filter ()
Gets the filter that will be selected by default in the file chooser dialog.
- public unowned ListModel? get_filters ()
Gets the filters that will be offered to the user in the file chooser dialog.
- public unowned File? get_initial_file ()
Gets the file that will be initially selected in the file chooser dialog.
- public unowned File? get_initial_folder ()
Gets the folder that will be set as the initial folder in the file chooser dialog.
- public unowned string? get_initial_name ()
Gets the filename that will be initially selected.
- public bool get_modal ()
Returns whether the file chooser dialog blocks interaction with the parent window while it is presented.
- public unowned string get_title ()
Returns the title that will be shown on the file chooser dialog.
- public async File? open (Window? parent, Cancellable? cancellable) throws Error
Presents a file chooser dialog to the user.
- public async ListModel? open_multiple (Window? parent, Cancellable? cancellable) throws Error
Presents a file chooser dialog to the user.
- public async File? save (Window? parent, Cancellable? cancellable) throws Error
Presents a file chooser dialog to the user.
- public async File? select_folder (Window? parent, Cancellable? cancellable) throws Error
Presents a file chooser dialog to the user.
- public async ListModel? select_multiple_folders (Window? parent, Cancellable? cancellable) throws Error
Presents a file chooser dialog to the user.
- public void set_accept_label (string? accept_label)
Sets the label shown on the file chooser's accept button.
- public void set_default_filter (FileFilter? filter)
Sets the filter that will be selected by default in the file chooser dialog.
- public void set_filters (ListModel? filters)
Sets the filters that will be offered to the user in the file chooser dialog.
- public void set_initial_file (File? file)
Sets the file that will be initially selected in the file chooser dialog.
- public void set_initial_folder (File? folder)
Sets the folder that will be set as the initial folder in the file chooser dialog.
- public void set_initial_name (string? name)
Sets the filename that will be initially selected.
- public void set_modal (bool modal)
Sets whether the file chooser dialog blocks interaction with the parent window while it is presented.
- public void set_title (string title)
Sets the title that will be shown on the file chooser dialog.
Inherited Members:
All known members inherited from class GLib.Object