summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--area_darwin.m4
-rw-r--r--delegateuitask_darwin.m3
-rw-r--r--listbox_darwin.m4
-rw-r--r--objc_darwin.m5
-rw-r--r--sysdata_darwin.m5
5 files changed, 14 insertions, 7 deletions
diff --git a/area_darwin.m b/area_darwin.m
index 6c58910..a34dcdb 100644
--- a/area_darwin.m
+++ b/area_darwin.m
@@ -17,6 +17,8 @@
#define toNSUInteger(x) ((NSUInteger) (x))
#define fromNSUInteger(x) ((uintptr_t) (x))
+extern NSRect dummyRect;
+
@interface areaView : NSView {
NSTrackingArea *trackingArea;
}
@@ -103,7 +105,7 @@ keyEvent(flagsChanged, areaView_flagsChanged)
id makeArea(void)
{
return [[areaView alloc]
- initWithFrame:NSMakeRect(0, 0, 100, 100)];
+ initWithFrame:dummyRect];
}
void drawImage(void *pixels, intptr_t width, intptr_t height, intptr_t stride, intptr_t xdest, intptr_t ydest)
diff --git a/delegateuitask_darwin.m b/delegateuitask_darwin.m
index 9aeabaf..52074d6 100644
--- a/delegateuitask_darwin.m
+++ b/delegateuitask_darwin.m
@@ -10,6 +10,8 @@
#include <Foundation/NSAutoreleasePool.h>
#include <AppKit/NSEvent.h>
+extern NSRect dummyRect;
+
@interface appDelegate : NSObject
@end
@@ -56,6 +58,7 @@ id windowGetContentView(id window)
BOOL initCocoa(id appDelegate)
{
+ dummyRect = NSMakeRect(0, 0, 100, 100);
[NSApplication sharedApplication];
if ([NSApp setActivationPolicy:NSApplicationActivationPolicyRegular] != YES)
return NO;
diff --git a/listbox_darwin.m b/listbox_darwin.m
index 5f3fe88..ff427fd 100644
--- a/listbox_darwin.m
+++ b/listbox_darwin.m
@@ -19,6 +19,8 @@
#define toNSUInteger(x) ((NSUInteger) (x))
#define fromNSUInteger(x) ((uintptr_t) (x))
+extern NSRect dummyRect;
+
id toListboxItem(id key, id value)
{
return [NSMutableDictionary dictionaryWithObject:value forKey:key];
@@ -101,7 +103,7 @@ id makeListbox(id tableColumn, BOOL multisel)
NSTableView *listbox;
listbox = [[NSTableView alloc]
- initWithFrame:NSMakeRect(0, 0, 100, 100)];
+ initWithFrame:dummyRect];
[listbox addTableColumn:tableColumn];
[listbox setAllowsMultipleSelection:multisel];
[listbox setAllowsEmptySelection:YES];
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];
diff --git a/sysdata_darwin.m b/sysdata_darwin.m
index bb2b1a7..c0d5cab 100644
--- a/sysdata_darwin.m
+++ b/sysdata_darwin.m
@@ -14,8 +14,7 @@
#include <AppKit/NSProgressIndicator.h>
#include <AppKit/NSScrollView.h>
-// because the only way to make a new NSControl/NSView is with a frame (it gets overridden later)
-static NSRect dummyRect;// = NSMakeRect(0, 0, 100, 100);
+extern NSRect dummyRect;
#define to(T, x) ((T *) (x))
#define toNSWindow(x) to(NSWindow, (x))
@@ -60,8 +59,6 @@ id makeWindow(id delegate)
{
NSWindow *w;
- // TODO separate to initilaizer
- dummyRect = NSMakeRect(0, 0, 100, 100);
w = [[NSWindow alloc]
initWithContentRect:dummyRect
styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)