summaryrefslogtreecommitdiff
path: root/redo/container_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
commit77bf566ebbcb62acd4d08d905d9542d6ff9b6b80 (patch)
treeeeb8e72bc3bf57f5be7f0c0af4319189ac6de838 /redo/container_darwin.m
parent155899c65ed32245e2ccad4197a10c77017d835b (diff)
...in with the new.
Diffstat (limited to 'redo/container_darwin.m')
-rw-r--r--redo/container_darwin.m44
1 files changed, 0 insertions, 44 deletions
diff --git a/redo/container_darwin.m b/redo/container_darwin.m
deleted file mode 100644
index 0a598c6..0000000
--- a/redo/container_darwin.m
+++ /dev/null
@@ -1,44 +0,0 @@
-// 4 august 2014
-
-#include "objc_darwin.h"
-#include "_cgo_export.h"
-#include <Cocoa/Cocoa.h>
-
-#define toNSView(x) ((NSView *) (x))
-
-// calling -[className] on the content views of NSWindow, NSTabItem, and NSBox all return NSView, so I'm assuming I just need to override these
-// fornunately:
-// - NSWindow resizing calls -[setFrameSize:] (but not -[setFrame:])
-// - NSTab resizing calls both -[setFrame:] and -[setFrameSIze:] on the current tab
-// - NSTab switching tabs calls both -[setFrame:] and -[setFrameSize:] on the new tab
-// so we just override setFrameSize:
-// thanks to mikeash and JtRip in irc.freenode.net/#macdev
-@interface goContainerView : NSView {
-@public
- void *gocontainer;
-}
-@end
-
-@implementation goContainerView
-
-- (void)setFrameSize:(NSSize)s
-{
- [super setFrameSize:s];
- containerResized(self->gocontainer, (intptr_t) s.width, (intptr_t) s.height);
-}
-
-@end
-
-id newContainerView(void *gocontainer)
-{
- goContainerView *c;
-
- c = [[goContainerView alloc] initWithFrame:NSZeroRect];
- c->gocontainer = gocontainer;
- return (id) c;
-}
-
-void moveControl(id c, intptr_t x, intptr_t y, intptr_t width, intptr_t height)
-{
- [toNSView(c) setFrame:NSMakeRect((CGFloat) x, (CGFloat) y, (CGFloat) width, (CGFloat) height)];
-}