The OpenD Programming Language

getOpenFileName

Gets a file name for an open or save operation, calling your onOK function when the user has selected one. This function may or may not block depending on the operating system, you MUST assume it will complete asynchronously.

void
getOpenFileName
(
void delegate
(
string
)
onOK
,
string prefilledName = null
,
string[] filters = null
,
void delegate
()
onCancel = null
,
string initialDirectory = null
)

Meta

History

onCancel was added November 6, 2021.

The dialog itself on Linux was modified on December 2, 2021 to include a directory picker in addition to the command line completion view.

The initialDirectory argument was added November 9, 2022 (dub v10.10)

Future directions

I want to add some kind of custom preview and maybe thumbnail thing in the future, at least on Linux, maybe on Windows too.