Hello,
I’m building a file selector using this code:
loadFileSelector = CNewFileSelector::create(getFrame(), CNewFileSelector::kSelectFile);
if (loadFileSelector)
{
loadFileSelector->setDefaultExtension(CFileExtension("JSON file", "json"));
loadFileSelector->setTitle("Choose a sound bank file...");
loadFileSelector->run(this);
loadFileSelector->forget();
}
When the select file dialog appears on OSX (I’m testing it on 10.10, building for 10.7 target), I keep seeing all the files as selectable, while I was expecting to see only the file with the extension specified (“json” in this case) as selectable and the rest greyed out.
I did some debugging on macfileselector.mm and this block of code is getting executed:
if (openPanel)
{
#if MAC_COCOA
if (parentWindow)
{
setupInitalDir ();
openPanel.allowedFileTypes = typesArray;
remember ();
[openPanel beginSheetModalForWindow:parentWindow completionHandler:^(NSInteger result) {
openPanelDidEnd (openPanel, result);
forget ();
}];
}
...
Everything looks fine, I see the typesArray correctly containing the “json” string, but I’m still able to select all the files from the dialog window…
Am I missing something? Everything works as expected on Windows…
Thanks in advance,
Federico