Signal2
Signal support.
FileDialog.swift:914class Signal2
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (24) members.
Types
enum Access
enum FileMode
class Signal1
Signal support.
class Signal3
Signal support.
Type members
Instance members
var access: FileDialog.Access
The file system access scope. See
Access
constants.var currentDir: String
The current working directory of the file dialog.
var currentFile: String
The currently selected file of the file dialog.
var currentPath: String
The currently selected file path of the file dialog.
var dirSelected: Signal3
Emitted when the user selects a directory.
var fileMode: FileDialog.FileMode
The dialog’s open or save mode, which affects the selection behavior. See
FileMode
.var fileSelected: Signal1
Emitted when the user selects a file by double-clicking it or pressing the OK button.
var filesSelected: Signal2
Emitted when the user selects multiple files.
var filters: PackedStringArray
The available file type filters. For example, this shows only
.png
and.gd
files:set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))
. Multiple file types can also be specified in a single filter."*.png, *.jpg, *.jpeg ; Supported Images"
will show both PNG and JPEG files when selected.var modeOverridesTitle: Bool
If
true
, changing thefileMode
property will set the window title accordingly (e.g. settingfileMode
to .openFile will change the window title to “Open a File”).var rootSubfolder: String
If non-empty, the given sub-folder will be “root” of this
FileDialog
, i.e. user won’t be able to go to its parent directory.var showHiddenFiles: Bool
If
true
, the dialog will show hidden files.var useNativeDialog: Bool
If
true
,access
is set to .filesystem, and it is supported by the currentDisplayServer
, OS native dialog will be used instead of custom one.func addFilter(String, description: String
) Adds a comma-delimited file name
filter
option to theFileDialog
with an optionaldescription
, which restricts what files can be picked.func clearFilters(
) Clear all the added filters in the dialog.
func deselectAll(
) Clear all currently selected items in the dialog.
func getLineEdit(
) -> LineEdit? Returns the LineEdit for the selected file.
func getVbox(
) -> VBoxContainer? Returns the vertical box container of the dialog, custom controls can be added to it.
func invalidate(
) Invalidate and update the current dialog content list.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ paths: PackedStringArray) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)