#include "cocoadisplay.h"
#include "cocoawindow.h"
-#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-@protocol NSWindowDelegate <NSObject> @end
-#endif
-
-@interface WindowDelegate: NSObject <NSWindowDelegate> {
+@interface MspWindow: NSWindow {
int dummy_member;
}
- (BOOL)windowShouldClose:(id)sender;
+- (void)keyDown:(NSEvent *)event;
@end
{
CocoaDisplay *display;
__strong NSWindow *window;
- __strong WindowDelegate *delegate;
NSUInteger style;
};
NSUInteger style = NSTitledWindowMask|NSClosableWindowMask;
if(resizable)
style |= NSResizableWindowMask;
- NSWindow *window = [NSWindow alloc];
+ NSWindow *window = [MspWindow alloc];
window = [window initWithContentRect:rect styleMask:style backing:NSBackingStoreBuffered defer:NO];
[window setAcceptsMouseMovedEvents:YES];
wrapper->window = window;
wrapper->style = style;
- wrapper->delegate = [[WindowDelegate alloc] init];
- [window setDelegate:wrapper->delegate];
-
if(!windows)
windows = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
CFDictionaryAddValue(windows, window, wrapper);
}
[window->window release];
- [window->delegate release];
free(window);
}
(void)window;
}
-@implementation WindowDelegate
+@implementation MspWindow
- (BOOL)windowShouldClose:(id)sender
{
return YES;
}
+- (void)keyDown:(NSEvent *)event
+{
+ // Eat the event to avoid beeping
+ (void)event;
+}
+
@end