summaryrefslogtreecommitdiff
path: root/redo/container_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-04 17:03:07 -0400
committerPietro Gagliardi <[email protected]>2014-08-04 17:03:07 -0400
commit1ba1f475ba1652d57ff569d42ede09944d74f2fb (patch)
tree8308b8319c81047d988fdc0da3c96450c2011aa8 /redo/container_darwin.m
parent39a2414cf94a6f69ddca853fd9ed97a576e30dd2 (diff)
Switched Tab on Mac OS X to use a dedicated container type system. This container type will eventually be the new home of all the sizer stuff. Now to remove the dedicated NSTabView stuff...
Diffstat (limited to 'redo/container_darwin.m')
-rw-r--r--redo/container_darwin.m33
1 files changed, 33 insertions, 0 deletions
diff --git a/redo/container_darwin.m b/redo/container_darwin.m
new file mode 100644
index 0000000..17ada72
--- /dev/null
+++ b/redo/container_darwin.m
@@ -0,0 +1,33 @@
+// 4 august 2014
+
+#include "objc_darwin.h"
+#include "_cgo_export.h"
+#include <Cocoa/Cocoa.h>
+
+// calling -[className] on the content views of NSWindow, NSTabItem, and NSBox all return NSView, so I'm assuming I just need to override these
+// fortunately, in the case of NSTabView, this -[setFrame:] is called when resizing and when changing tabs, so we can indeed use this directly there
+@interface goContainerView : NSView {
+@public
+ void *gocontainer;
+}
+@end
+
+@implementation goContainerView
+
+- (void)setFrame:(NSRect)r
+{
+ [super setFrame:r];
+ if (self->gocontainer != NULL)
+ containerResized(self->gocontainer, (intptr_t) r.size.width, (intptr_t) r.size.height);
+}
+
+@end
+
+id newContainerView(void *gocontainer)
+{
+ goContainerView *c;
+
+ c = [[goContainerView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
+ c->gocontainer = gocontainer;
+ return (id) c;
+}