feat: Added custom application delegate

This commit is contained in:
WerWolv
2025-01-26 13:32:35 +01:00
parent 403104dda1
commit d76e92933a

View File

@@ -59,6 +59,22 @@
}
@end
@interface ImHexAppDelegate : NSObject<NSApplicationDelegate>
@end
@implementation ImHexAppDelegate
- (void) application:(NSApplication*)sender openFiles:(NSArray*)filenames
{
NSLog(@"A");
[NSApp replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
- (IBAction) clickAction:(id)sender {
NSLog(@"B");
}
@end
void setupMacosWindowStyle(GLFWwindow *window, bool borderlessWindowMode) {
NSWindow* cocoaWindow = glfwGetCocoaWindow(window);
@@ -76,6 +92,9 @@
NSButton *closeButton = [cocoaWindow standardWindowButton:NSWindowCloseButton];
[closeButton setAction:@selector(pressed:)];
[closeButton setTarget:[CloseButtonHandler alloc]];
NSApplication *app = [NSApplication sharedApplication];
[app setDelegate:[ImHexAppDelegate alloc]];
}
bool isMacosFullScreenModeEnabled(GLFWwindow *window) {