Construct the dialog.
Construct the dialog.
Configures how the Save dialog reacts when the selected file already exists, and saving would overwrite it. A true value requests a confirmation dialog be presented to the user. A false value requests that the overwrite take place without confirmation. Default value is true.
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 SaveFileDialog("Save a file") .setConfirmOverwrite(true) .setDefaultExtension(".txt") .addFileType("{{All files} {*}}") .addFileType("{{Text files} {.txt}}") .setInitialDirectory("~") .setInitialFile("file.txt") .show(); string fileToWrite = dialog.getResult();
Result: The full path of the file selected.
Pops up a dialog box for the user to save a file.