Struct FileDialog

Dialog for selecting files or directories in the filesystem.

struct FileDialog ;

FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.

Properties

NameTypeDescription
access[get, set] FileDialog.AccessThe file system access scope. See enum Access constants.
currentDir[get, set] StringThe current working directory of the file dialog.
currentFile[get, set] StringThe currently selected file of the file dialog.
currentPath[get, set] StringThe currently selected file path of the file dialog.
filters[get, set] PoolArray!(godot.core.string.String)The available file type filters. For example, this shows only .png and .gd files: set_filters(PoolStringArray(class="pln">D "*.png ; PNG Images","*.gd ; GDScript Files")).
mode[get, set] FileDialog.ModeThe dialog's open or save mode, which affects the selection behavior. See enum Mode constants.
modeOverridesTitle[get, set] boolIf true, changing the Mode property will set the window title accordingly (e.g. setting mode to constant MODE_OPEN_FILE will change the window title to "Open a File").
showHiddenFiles[get, set] boolIf true, the dialog will show hidden files.

Methods

NameDescription
_actionPressed
_cancelPressed
_dirEntered
_fileEntered
_filterSelected
_goUp
_makeDir
_makeDirConfirm
_saveConfirmPressed
_selectDrive
_treeItemActivated
_treeMultiSelected
_treeSelected
_unhandledInput
_updateDir
_updateFileList
_updateFileName
addFilter Adds filter as a custom filter; filter should be of the form "filename.extension ; Description". For example, "*.png ; PNG Images".
clearFilters Clear all the added filters in the dialog.
deselectItems Clear currently selected items in the dialog.
getAccess
getCurrentDir
getCurrentFile
getCurrentPath
getFilters
getLineEdit Returns the LineEdit for the selected file.
getMode
getVbox Returns the vertical box container of the dialog, custom controls can be added to it.
invalidate Invalidate and update the current dialog content list.
isModeOverridingTitle
isShowingHiddenFiles
setAccess
setCurrentDir
setCurrentFile
setCurrentPath
setFilters
setMode
setModeOverridesTitle
setShowHiddenFiles

Enums

NameDescription
Access
Constants
Mode