and now for macOS

blind coding - untested.....
This commit is contained in:
tildearrow 2024-09-28 00:41:02 -05:00
parent ab006d5d78
commit 078055526d

View file

@ -149,6 +149,12 @@ nfdresult_t NFD_OpenDialog( const std::vector<std::string>& filterList,
// Set the starting directory
SetDefaultPath(dialog, defaultPath);
// Set the file name
if (defaultFileName!=NULL) {
NSString* defFileName=[NSString stringWithUTF8String:defaultFileName];
[dialog setNameFieldStringValue:defFileName];
}
nfdresult_t nfdResult = NFD_CANCEL;
if ( [dialog runModal] == NSModalResponseOK )
{
@ -192,6 +198,12 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
// Set the starting directory
SetDefaultPath(dialog, defaultPath);
// Set the file name
if (defaultFileName!=NULL) {
NSString* defFileName=[NSString stringWithUTF8String:defaultFileName];
[dialog setNameFieldStringValue:defFileName];
}
nfdresult_t nfdResult = NFD_CANCEL;
if ( [dialog runModal] == NSModalResponseOK )
@ -239,6 +251,12 @@ nfdresult_t NFD_SaveDialog( const std::vector<std::string>& filterList,
// Set the starting directory
SetDefaultPath(dialog, defaultPath);
// Set the file name
if (defaultFileName!=NULL) {
NSString* defFileName=[NSString stringWithUTF8String:defaultFileName];
[dialog setNameFieldStringValue:defFileName];
}
nfdresult_t nfdResult = NFD_CANCEL;
if ( [dialog runModal] == NSModalResponseOK )
{