Construct the dialog.
Construct the dialog.
Get multiple dialog results.
Set whether to enable mutli-selection.
Show the dialog.
Set the default extension.
Add an allowed file type. If a filetype combobox exists in the file dialog on the particular platform, this adds entries to it. When the user choose a filetype in the combobox, only the files of that type are listed. If no types are added or if the filetypes combobox is not supported by the particular platform then all files are listed regardless of their types.
Set the initial directory in the dialog.
Set the initial file in the dialog.
auto dialog = new OpenFileDialog("Open a file") .setMultiSelection(false) .setDefaultExtension(".txt") .addFileType("{{All files} {*}}") .addFileType("{{Text files} {.txt}}") .setInitialDirectory("~") .setInitialFile("file.txt") .show(); string fileToOpen = dialog.getResult();
Result: The full path of the file selected.
Pops up a dialog box for the user to open a file.