In a final clean-up of aging Carbon code, I rewrote old NavGetFile code to use
the NavCreateGetFileDialog(). That all worked well, except for one issue:
When I tried to set the "default" location in the event proc (for event
kNavCBStart), it just NEVER will accept my FSRef for my desired folder:
if (inSelector == kNavCBStart)
{
FSRef theFSRef = CMultiFormatChooser::GetDefaultLocation_RS();
AEDesc theDesiredLocation;
OSErr err = ::AECreateDesc(typeFSRef, &theFSRef, sizeof(FSRef),
&theDesiredLocation);
Assert_(err == noErr);
OSStatus theStatus = NavCustomControl(ioParams->context,
kNavCtlSetLocation, &theDesiredLocation);
Assert_(theStatus == noErr);
}
But even odder, if I DON'T try to explicitly set it, then the GetFileDialog
will NOT remember the last folder it visited -- which the documentation says it
will. It just defaults to "Documents".
I've even set the preferenceKey to some arbitrary number (1010), because I
thought that's a requirement to have one defined.
It seems like this behavior with being able to set a specific folder explicitly
may have changed (even for the old NavGetFile), perhaps with sandbox changes
around 10.10 - 10.11?
Anyone have any insights?
Stephen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/carbon-dev/archive%40mail-archive.com
This email sent to [email protected]