How do I specify the initial directory and file name in a FileChooser save dialog? Suppose I want the initial text to be “MyFile.text”, and I want the initial directory to be the desktop. Here’s what I’m doing currently:
FileChooser myChooser ( T("Save File As"), (File::getSpecialLocation(File::userDesktopDirectory)).getChildFile("MyFile.text"), T("*.txt")); if(myChooser.browseForFileToSave(true)) ... do stuff ...
On Windows, this seems to work fine, but on the Mac this doesn’t seem to do anything. The initial directory is always whatever the user last navigated to the last time the save dialog was shown, and the initial filename is always “untitled”. This happens regardless of whether MyFile.txt already exists or not.
Am I doing something dumb?