CFFI hookups for nfd "open directory" functionality

This commit is contained in:
Lars A. Doucet
2015-12-17 10:34:41 -06:00
committed by Joshua Granick
parent 97fb0dcccc
commit 1ddb43b990
5 changed files with 53 additions and 2 deletions

View File

@@ -6,6 +6,34 @@
namespace lime {
const char* FileDialog::OpenDirectory (const char* filter, const char* defaultPath) {
nfdchar_t *savePath = 0;
nfdresult_t result = NFD_OpenDirectoryDialog (filter, defaultPath, &savePath);
switch (result) {
case NFD_OKAY:
return savePath;
break;
case NFD_CANCEL:
break;
default:
printf ("Error: %s\n", NFD_GetError ());
break;
}
return savePath;
}
const char* FileDialog::OpenFile (const char* filter, const char* defaultPath) {
nfdchar_t *savePath = 0;