summaryrefslogtreecommitdiff
path: root/new/container_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-07 15:45:00 -0400
committerPietro Gagliardi <[email protected]>2015-04-07 15:45:56 -0400
commit96e25cf50293d2c8f33bbd4d2578a4e2b63441f9 (patch)
tree59e11ab0eeff206f4bbfb1460d44b35e4e5dc7ea /new/container_darwin.m
parenta013fe638412809fe3dd18f0231d68d1ce469d56 (diff)
Added the Mac OS X uiContainer. Added it to uiWindow. Added the Mac OS X coordinate system mirroring to the new control logic. Renamed *_darwin.c to *_darwin.m.
Diffstat (limited to 'new/container_darwin.m')
-rw-r--r--new/container_darwin.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/new/container_darwin.m b/new/container_darwin.m
new file mode 100644
index 0000000..7f628a3
--- /dev/null
+++ b/new/container_darwin.m
@@ -0,0 +1,22 @@
+// 4 august 2014
+#import "uipriv_darwin.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
+// 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
+@implementation uiContainer
+
+- (void)setFrameSize:(NSSize)s
+{
+ uiSizing d;
+
+ [super setFrameSize:s];
+ if (self.child != NULL)
+ (*(self.child->resize))(self.child, 0, 0, [self bounds].size.width, [self bounds].size.height, d);
+}
+
+@end