gtk.file_dialog
Module for [FileDialog] class
Types 3
A gtk.file_dialog.FileDialog object collects the arguments that are needed to present a file chooser dialog to the user, such as a title for the dialog and whether it should be modal.
The dialog is shown with gtk.file_dialog.FileDialog.open, gtk.file_dialog.FileDialog.save, etc. These APIs follow the GIO async pattern, and the result can be obtained by calling the corresponding finish function, for example gtk.file_dialog.FileDialog.openFinish.
Methods
FileDialogGidBuilder builder() static nothrowGet builder for [gtk.file_dialog.FileDialog] Returns: New builder objectstring acceptLabel() @property nothrowGet `acceptLabel` property. Returns: Label for the file chooser's accept button.void acceptLabel(string propval) @property nothrowSet `acceptLabel` property. Params: propval = Label for the file chooser's accept button.gtk.file_filter.FileFilter defaultFilter() @property nothrowGet `defaultFilter` property. Returns: The default filter, that is, the filter that is initially active in the file chooser dialog.void defaultFilter(gtk.file_filter.FileFilter propval) @property nothrowSet `defaultFilter` property. Params: propval = The default filter, that is, the filter that is initially active in the file chooser dialog.gio.list_model.ListModel filters() @property nothrowGet `filters` property. Returns: The list of filters.void filters(gio.list_model.ListModel propval) @property nothrowSet `filters` property. Params: propval = The list of filters.gio.file.File initialFile() @property nothrowGet `initialFile` property. Returns: The initial file, that is, the file that is initially selected in the file chooser dialogvoid initialFile(gio.file.File propval) @property nothrowSet `initialFile` property. Params: propval = The initial file, that is, the file that is initially selected in the file chooser dialoggio.file.File initialFolder() @property nothrowGet `initialFolder` property. Returns: The initial folder, that is, the directory that is initially opened in the file chooser dialogvoid initialFolder(gio.file.File propval) @property nothrowSet `initialFolder` property. Params: propval = The initial folder, that is, the directory that is initially opened in the file chooser dialogstring initialName() @property nothrowGet `initialName` property. Returns: The initial name, that is, the filename that is initially selected in the file chooser dialog.void initialName(string propval) @property nothrowSet `initialName` property. Params: propval = The initial name, that is, the filename that is initially selected in the file chooser dialog.bool modal() @property nothrowGet `modal` property. Returns: Whether the file chooser dialog is modal.void modal(bool propval) @property nothrowSet `modal` property. Params: propval = Whether the file chooser dialog is modal.string title() @property nothrowGet `title` property. Returns: A title that may be shown on the file chooser dialog.void title(string propval) @property nothrowSet `title` property. Params: propval = A title that may be shown on the file chooser dialog.string getAcceptLabel() nothrowgtk.file_filter.FileFilter getDefaultFilter() nothrowGets the filter that will be selected by default in the file chooser dialog. Returns: the current filtergio.list_model.ListModel getFilters() nothrowGets the filters that will be offered to the user in the file chooser dialog. Returns: the filters, as a [gio.list_model.ListModel] of `GtkFileFilters`gio.file.File getInitialFile() nothrowGets the file that will be initially selected in the file chooser dialog. Returns: the filegio.file.File getInitialFolder() nothrowGets the folder that will be set as the initial folder in the file chooser dialog. Returns: the folderstring getInitialName() nothrowGets the name for the file that should be initially set. Returns: the namebool getModal() nothrowReturns whether the file chooser dialog blocks interaction with the parent window while it is presented. Returns: `TRUE` if the file chooser dialog is modalstring getTitle() nothrowReturns the title that will be shown on the file chooser dialog. Returns: the titlevoid open(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowThis function initiates a file selection operation by presenting a file chooser dialog to the user.gio.file.File openFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_dialog.FileDialog.open] call and returns the resulting file.void openMultiple(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowThis function initiates a multi-file selection operation by presenting a file chooser dialog to the user.gio.list_model.ListModel openMultipleFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_dialog.FileDialog.open] call and returns the resulting files in a [gio.list_model.ListModel].void save(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowThis function initiates a file save operation by presenting a file chooser dialog to the user.gio.file.File saveFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_dialog.FileDialog.save] call and returns the resulting file.void selectFolder(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowThis function initiates a directory selection operation by presenting a file chooser dialog to the user.gio.file.File selectFolderFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_dialog.FileDialog.selectFolder] call and returns the resulting file.void selectMultipleFolders(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowThis function initiates a multi-directory selection operation by presenting a file chooser dialog to the user.gio.list_model.ListModel selectMultipleFoldersFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_dialog.FileDialog.selectMultipleFolders] call and returns the resulting files in a [gio.list_model.ListModel].void setAcceptLabel(string acceptLabel = null) nothrowSets the label shown on the file chooser's accept button.void setDefaultFilter(gtk.file_filter.FileFilter filter = null) nothrowSets the filter that will be selected by default in the file chooser dialog.void setFilters(gio.list_model.ListModel filters = null) nothrowSets the filters that will be offered to the user in the file chooser dialog.void setInitialFile(gio.file.File file = null) nothrowSets the file that will be initially selected in the file chooser dialog.void setInitialFolder(gio.file.File folder = null) nothrowSets the folder that will be set as the initial folder in the file chooser dialog.void setInitialName(string name = null) nothrowSets the name for the file that should be initially set. For saving dialogs, this will usually be pre-entered into the name field.void setModal(bool modal) nothrowSets whether the file chooser dialog blocks interaction with the parent window while it is presented.Fluent builder implementation template for gtk.file_dialog.FileDialog
Methods
T acceptLabel(string propval) nothrowSet `acceptLabel` property. Params: propval = Label for the file chooser's accept button. Returns: Builder instance for fluent chainingT defaultFilter(gtk.file_filter.FileFilter propval) nothrowSet `defaultFilter` property. Params: propval = The default filter, that is, the filter that is initially active in the file chooser dialog.T filters(gio.list_model.ListModel propval) nothrowSet `filters` property. Params: propval = The list of filters.T initialFile(gio.file.File propval) nothrowSet `initialFile` property. Params: propval = The initial file, that is, the file that is initially selected in the file chooser dialogT initialFolder(gio.file.File propval) nothrowSet `initialFolder` property. Params: propval = The initial folder, that is, the directory that is initially opened in the file chooser dialog Returns: Builder instance for fluent chainingT initialName(string propval) nothrowSet `initialName` property. Params: propval = The initial name, that is, the filename that is initially selected in the file chooser dialog. Returns: Builder instance for fluent chainingT modal(bool propval) nothrowSet `modal` property. Params: propval = Whether the file chooser dialog is modal. Returns: Builder instance for fluent chainingT title(string propval) nothrowSet `title` property. Params: propval = A title that may be shown on the file chooser dialog. Returns: Builder instance for fluent chainingFluent builder for gtk.file_dialog.FileDialog
Methods