Revert of shiny/driver: repace style mask and event constants deprecated since OSX 10.12
Reason for revert: constants not available on older OS X releases
Original issue's description:
> shiny/driver: repace style mask and event constants deprecated since OSX 10.12
>
> Fixes golang/go#17413.
>
> Change-Id: I4cc8a980fc1d6a45ceef48b282baa7a94663ae10
> Reviewed-on: https://go-review.googlesource.com/31539
> Reviewed-by: David Crawshaw <crawshaw@golang.org>
>
Change-Id: I35bd4301ebf63689d6b7bb49a29b9ef85657ba1e
Reviewed-on: https://go-review.googlesource.com/31613
Reviewed-by: David Crawshaw <crawshaw@golang.org>
diff --git a/shiny/driver/gldriver/cocoa.m b/shiny/driver/gldriver/cocoa.m
index 92dcef9..1d07af7 100644
--- a/shiny/driver/gldriver/cocoa.m
+++ b/shiny/driver/gldriver/cocoa.m
@@ -107,7 +107,7 @@
double y = (h - p.y) * scale - 1; // flip origin from bottom-left to top-left.
double dx, dy;
- if (theEvent.type == NSEventTypeScrollWheel) {
+ if (theEvent.type == NSScrollWheel) {
dx = theEvent.scrollingDeltaX;
dy = theEvent.scrollingDeltaY;
}
@@ -161,7 +161,7 @@
uint8_t direction;
if ([theEvent isARepeat]) {
direction = 0;
- } else if (theEvent.type == NSEventTypeKeyDown) {
+ } else if (theEvent.type == NSKeyDown) {
direction = 1;
} else {
direction = 2;
@@ -250,12 +250,12 @@
NSRect rect = NSMakeRect(0, 0, w, h);
NSWindow* window = [[NSWindow alloc] initWithContentRect:rect
- styleMask:NSWindowStyleMaskTitled
+ styleMask:NSTitledWindowMask
backing:NSBackingStoreBuffered
defer:NO];
- window.styleMask |= NSWindowStyleMaskResizable;
- window.styleMask |= NSWindowStyleMaskMiniaturizable;
- window.styleMask |= NSWindowStyleMaskClosable;
+ window.styleMask |= NSResizableWindowMask;
+ window.styleMask |= NSMiniaturizableWindowMask ;
+ window.styleMask |= NSClosableWindowMask;
window.title = name;
window.displaysWhenScreenProfileChanges = YES;
[window cascadeTopLeftFromPoint:NSMakePoint(20,20)];