Fantom

 

class

fwt::FileDialog

sys::Obj
  fwt::FileDialog

FileDialog is used to prompt for file and directory selections. This class isn't actually a dialog, it merely defines the various options used to open the operating system's native file dialog.

Slots

dirSource

const File? dir

The initial directory to display

filterExtsSource

const Str[]? filterExts := null

File extensions to display, for example:

filterExts = ["*.gif", "*.png", "*.jpg"]
makeSource

new make(|FileDialog|? f := null)

Default constructor.

modeSource

const FileDialogMode mode := FileDialogMode.openFile

Mode is used to define whether we are opening or saving a single file, multiple files, or a directory.

nameSource

const Str? name

The initial filename to display

openSource

native Obj? open(Window? parent)

Return the user selection or null if canceled. Result is based on mode:

  • openFile: File
  • openFiles: File[]
  • saveFile: File
  • openDir: File