openFileDialog

fun openFileDialog(programName: String = stackRootClassName(), contextID: String = "global", defaultPath: String? = getDefaultPathForContext(programName, contextID), supportedExtensions: List<Pair<String, List<String>>> = emptyList(), function: (File) -> Unit)(source)

Creates a file dialog that can be used to open a single file

Parameters

programName

optional name of the program, this is guessed from a stack trace by default

contextID

optional context identifier, default is "global"

supportedExtensions

a list with supported/allowed extensions sets. Usage: listOf("vector" to listOf("svg", "ai"), "bitmap" to listOf("jpg", "JPG"))

function

the function to be invoked when a file has been picked

See also