diff --git a/AppKit/CPTabView.j b/AppKit/CPTabView.j index a5fc880b5..7d9d943fe 100644 --- a/AppKit/CPTabView.j +++ b/AppKit/CPTabView.j @@ -520,6 +520,17 @@ var CPTabViewItemsKey = "CPTabViewItemsKey", return self; } +- (void)awakeFromCib +{ + // This is a quick and dirty fix of the tab view item we decode and install in _box + // having a different _superview decoded later in the decoding process - e.g. the + // CPTabView itself as is the case when we're coming from an xib. This solution could + // probably be improved by fixing this in nib2cib instead, but the _box doesn't yet + // exist then so it's not totally clear what to change the superview to at that stage. + if ([_box contentView]) + _box._contentView._superview = _box; +} + - (void)encodeWithCoder:(CPCoder)aCoder { [super encodeWithCoder:aCoder];