mirror of
https://github.com/libretro/sameduck.git
synced 2024-11-23 09:09:41 +00:00
21 lines
531 B
Objective-C
21 lines
531 B
Objective-C
#import <AppKit/AppKit.h>
|
|
#include "open_dialog.h"
|
|
|
|
|
|
char *do_open_rom_dialog(void)
|
|
{
|
|
@autoreleasepool {
|
|
NSWindow *key = [NSApp keyWindow];
|
|
NSOpenPanel *dialog = [NSOpenPanel openPanel];
|
|
dialog.title = @"Open ROM";
|
|
dialog.allowedFileTypes = @[@"gb", @"gbc", @"sgb"];
|
|
[dialog runModal];
|
|
[key makeKeyAndOrderFront:nil];
|
|
NSString *ret = [[[dialog URLs] firstObject] path];
|
|
if (ret) {
|
|
return strdup(ret.UTF8String);
|
|
}
|
|
return NULL;
|
|
}
|
|
}
|