summaryrefslogtreecommitdiff
path: root/redo/container_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-04 17:28:53 -0400
committerPietro Gagliardi <[email protected]>2014-08-04 17:28:53 -0400
commit6010665415aa8ac80effd5d4caea80ea5628166b (patch)
treee412b46f141605383dcdd360233c64198be4705e /redo/container_darwin.m
parent84297ad7e13d3f10e967358ad10e286e9e193584 (diff)
Converted Window on Mac OS X to use the new container system. Now I can merge container and sizing...
Diffstat (limited to 'redo/container_darwin.m')
-rw-r--r--redo/container_darwin.m13
1 files changed, 9 insertions, 4 deletions
diff --git a/redo/container_darwin.m b/redo/container_darwin.m
index 17ada72..8f1e3ac 100644
--- a/redo/container_darwin.m
+++ b/redo/container_darwin.m
@@ -5,7 +5,11 @@
#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
+// 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:
@interface goContainerView : NSView {
@public
void *gocontainer;
@@ -14,11 +18,12 @@
@implementation goContainerView
-- (void)setFrame:(NSRect)r
+- (void)setFrameSize:(NSSize)s
{
- [super setFrame:r];
+NSLog(@"setFrameSize %@", NSStringFromSize(s));
+ [super setFrameSize:s];
if (self->gocontainer != NULL)
- containerResized(self->gocontainer, (intptr_t) r.size.width, (intptr_t) r.size.height);
+ containerResized(self->gocontainer, (intptr_t) s.width, (intptr_t) s.height);
}
@end