add file picker to osx
This commit is contained in:
@@ -204,15 +204,15 @@ void App::pick_file_save(std::vector<std::string> types, std::function<void (std
|
||||
// [ios_view pick_photo:callback];
|
||||
//});
|
||||
#elif __OSX__
|
||||
//dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// //NSArray* fileTypes = [NSArray arrayWithObjects:@"ppi", @"PPI", nil];
|
||||
// NSMutableArray<NSString*>* fileTypes = [NSMutableArray arrayWithCapacity:types.size()];
|
||||
// for (const auto& t : types)
|
||||
// [fileTypes addObject:[NSString stringWithCString:t.c_str() encoding:NSUTF8StringEncoding]];
|
||||
// std::string path = [osx_view pick_file:fileTypes];
|
||||
// if (!path.empty())
|
||||
// callback(path);
|
||||
//});
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
//NSArray* fileTypes = [NSArray arrayWithObjects:@"ppi", @"PPI", nil];
|
||||
NSMutableArray<NSString*>* fileTypes = [NSMutableArray arrayWithCapacity:types.size()];
|
||||
for (const auto& t : types)
|
||||
[fileTypes addObject:[NSString stringWithCString:t.c_str() encoding:NSUTF8StringEncoding]];
|
||||
std::string path = [osx_view pick_file_save:fileTypes];
|
||||
if (!path.empty())
|
||||
callback(path);
|
||||
});
|
||||
#elif __ANDROID__
|
||||
//android_pick_file(callback);
|
||||
#elif _WIN32
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
NodeBorder* m_progress;
|
||||
NodeBorder* m_body;
|
||||
int m_total = 0;
|
||||
std::atomic_int m_count = 0;
|
||||
std::atomic_int m_count{0};
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void init() override;
|
||||
void increment() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user