From dec7ca1e194171697ba523d62a7cf97023df8bb5 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Sat, 14 Jul 2012 10:32:21 -0700 Subject: [PATCH] Make NSClipView obey the Draw Background checkbox in IB --- Tools/nib2cib/NSClipView.j | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Tools/nib2cib/NSClipView.j b/Tools/nib2cib/NSClipView.j index a60e3c82f..eb7ed5c88 100644 --- a/Tools/nib2cib/NSClipView.j +++ b/Tools/nib2cib/NSClipView.j @@ -23,18 +23,21 @@ @import +var NSClipViewDrawBackgroundFlag = 0x04; + + @implementation CPClipView (CPCoding) - (id)NS_initWithCoder:(CPCoder)aCoder { if (self = [super NS_initWithCoder:aCoder]) { - _documentView = [aCoder decodeObjectForKey:"NSDocView"]; + _documentView = [aCoder decodeObjectForKey:@"NSDocView"]; - if ([aCoder containsValueForKey:"NSBGColor"]) - [self setBackgroundColor:[aCoder decodeObjectForKey:"NSBGColor"]]; + var flags = [aCoder decodeIntForKey:@"NScvFlags"]; - //var flags = [aCoder decodeIntForKey:"NScvFlags"]; + if ((flags & NSClipViewDrawBackgroundFlag) && [aCoder containsValueForKey:@"NSBGColor"]) + [self setBackgroundColor:[aCoder decodeObjectForKey:@"NSBGColor"]]; } return self;