FileDialog
Base class for file dialogs.
| Module | require("gui") |
| Type | Class |
Class properties
Integer optionPickFolders
Option that indicates the open dialog will open folders instead of files.
Integer optionMultiSelect
Option that indicates the open dialog can select multiple items.
Integer optionShowHidden
Option that indicates hidden files will always show in the dialog.
Methods
getResult()
Return the chosen item in dialog.
Return
Stringrun()
Show the dialog and wait for result, return true if user has chosen
item(s).
Return
BooleanrunForWindow(window)
Show the dialog as a modal child of parent window and wait for result,
return true if user has chosen item(s).
Parameters
Windowwindow
Return
BooleansetTitle(title)
Set the title of the dialog.
Parameters
Stringtitle
setButtonLabel(label)
Set the text of accept button.
Parameters
Stringlabel
setFilename(filename)
Set the filename to show in the dialog.
Parameters
Stringfilename
setFolder(folder)
Set a folder that is always selected when the dialog is opened
On macOS file dialogs of sandboxed apps may silently ignore the folder selection, notwithstanding that the user may be able to subsequently navigate to the folder and the app successfully access files within the folder. The behavior depends on the app's entitlements and the particular folder specified.
Parameters
Stringfolder
setOptions(options)
A bit array of options.
Parameters
Integeroptions
setFilters(filters)
Set the file types that the dialog can open or save.
Parameters
Arrayfilters - An array ofFileDialog::Filterobjects.