fix some ui glitch with NodeButton, start implementing working dir option

This commit is contained in:
2018-10-06 16:17:42 +02:00
parent 739784b0d1
commit 05decb6a05
9 changed files with 74 additions and 16 deletions

View File

@@ -90,6 +90,27 @@ void App::pick_file(std::vector<std::string> types, std::function<void (std::str
#endif
}
void App::pick_dir(std::function<void(std::string path)> callback)
{
redraw = true;
#ifdef __IOS__
// NOT IMPLEMENTED
#elif __OSX__
dispatch_async(dispatch_get_main_queue(), ^{
std::string path = [osx_view pick_dir];
if (!path.empty())
callback(path);
});
#elif __ANDROID__
// NOT IMPLEMENTED
#elif _WIN32
// TODO: to be implemented
// std::string path = win32_open_file();
// if (!path.empty())
// callback(path);
#endif
}
void App::display_file(std::string path)
{
#ifdef __IOS__