- First commit to gitea

This commit is contained in:
2026-02-12 10:51:02 +01:00
commit a16a5a4102
40 changed files with 10033 additions and 0 deletions

29
GUIDialogs.mm Normal file
View File

@@ -0,0 +1,29 @@
#include "GUIDialogs.h"
#import <AppKit/AppKit.h>
namespace GUIDialogs
{
char* ChooseFile()
{
NSWindow *keyWindow = [NSApp keyWindow];
char* path = nullptr;
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:YES];
[panel setCanChooseDirectories:NO];
[panel setAllowsMultipleSelection:NO];
NSInteger clicked = [panel runModal];
if (clicked == NSFileHandlingPanelOKButton) {
for (NSURL *url in [panel URLs]) {
path = strdup([url fileSystemRepresentation]);
//const char* urlPath = [url fileSystemRepresentation];
//path = (char*)malloc(strlen(urlPath));
//strcpy(path, urlPath);
}
}
[keyWindow makeKeyWindow];
return path;
}
}