FileDialog

class FileDialog(val native: Boolean)

File Open, File Save and Folder Picker dialogs.

Note. There is an option to use native controls, or Glok controls. (See native boolean parameter of the constructor).

Initially, only native controls were possible, but I added Glok controls, and made this the default because :

  1. The native library seems to have a critical bug when running on Linux. It very occasionally crashes the application :-(

  2. The native dialogs really annoy me - they ignore the initialDirectory I've read somewhere that this is deliberate, because users were confused by this feature. WTF? So now I have to navigate to the same folder again and again just to Save-As with a new name? No!

  3. The native library's API is dreadful, and hints that it was written by a very poor programmer. I don't trust it!

  4. Filtering is a little naff. You can only filter by extension names, and not by general wildcard patterns.

The downsides of the Glok controls :

  1. Looks and behaves differently from the native controls

  2. Doesn't include favourite places.

But has some advantages too :

  1. Uses the same Theme as your application.

  2. Allows you to browse a folder using the file-manager (via a right-click menu).

The native controls look different (and familiar) depending on your platform (Window, MacOS, Linux). As they are native, they are not affected by your Theme.

Constructors

Link copied to clipboard
constructor()
constructor(native: Boolean)

Properties

Link copied to clipboard

Pairs of file type descriptions and file extensions. Each pair comprises a description (String) and a spec (String) with comma separated file extensions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun showFolderPicker(parentStage: Stage, callback: (File?) -> Unit)
Link copied to clipboard
fun showOpenDialog(parentStage: Stage, callback: (File?) -> Unit)
Link copied to clipboard
fun showSaveDialog(parentStage: Stage, callback: (File?) -> Unit)