From a9717bfb4fd6627d51dfc07c35f393f0a93368ff Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 16 May 2014 09:13:11 -0400 Subject: Organized the dummyRect declarations/definitions/etc. in the Objective-C files. I think that's it for the Objective-C conversion of the Mac OS X code! --- objc_darwin.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'objc_darwin.m') diff --git a/objc_darwin.m b/objc_darwin.m index 08113b6..09c2ec2 100644 --- a/objc_darwin.m +++ b/objc_darwin.m @@ -10,6 +10,9 @@ #define toNSView(x) to(NSView, (x)) #define toNSScrollView(x) to(NSScrollView, (x)) +// because the only way to make a new NSControl/NSView is with a frame (it gets overridden later) +NSRect dummyRect; + id toNSString(char *str) { return [NSString stringWithUTF8String:str]; @@ -43,7 +46,7 @@ id makeScrollView(id content) NSScrollView *scrollview; scrollview = [[NSScrollView alloc] - initWithFrame:NSMakeRect(0, 0, 100, 100)]; + initWithFrame:dummyRect]; [scrollview setHasHorizontalScroller:YES]; [scrollview setHasVerticalScroller:YES]; [scrollview setAutohidesScrollers:YES]; -- cgit v1.2.3