fix some ui glitch with NodeButton, start implementing working dir option
This commit is contained in:
@@ -61,6 +61,26 @@ std::mutex task_mutex;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
- (std::string)pick_dir
|
||||
{
|
||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||
[panel setCanChooseFiles:NO];
|
||||
[panel setCanChooseDirectories:YES];
|
||||
[panel setAllowsMultipleSelection:NO]; // yes if more than one dir is allowed
|
||||
|
||||
NSInteger clicked = [panel runModal];
|
||||
|
||||
std::string ret;
|
||||
if (clicked == NSFileHandlingPanelOKButton)
|
||||
{
|
||||
for (NSURL *url in [panel URLs])
|
||||
{
|
||||
LOG("selected path: %s", [[url path] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
ret = [[url path] cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
- (instancetype)initWithFrame:(NSRect)frameRect
|
||||
{
|
||||
gl_ready = false;
|
||||
|
||||
@@ -23,4 +23,5 @@
|
||||
- (void)async_unlock;
|
||||
- (void)async_swap;
|
||||
- (std::string)pick_file:(NSArray<NSString*>*)types;
|
||||
- (std::string)pick_dir;
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user