From b443cb806aaa9620aaf757d697a23df2e5bb39e5 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 28 Sep 2012 16:13:24 -0400 Subject: [PATCH] Both cells and controls can have tags in IB, control tag should take precedence --- AppKit/CPView.j | 1 + Tools/nib2cib/NSButton.j | 2 -- Tools/nib2cib/NSControl.j | 5 +++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AppKit/CPView.j b/AppKit/CPView.j index b11599d32..f25b03af0 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -2907,6 +2907,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask", [self _setupToolTipHandlers]; _toolTip = [aCoder decodeObjectForKey:CPViewToolTipKey]; + if (_toolTip) [self _installToolTipEventHandlers]; diff --git a/Tools/nib2cib/NSButton.j b/Tools/nib2cib/NSButton.j index 59437de96..f5597344c 100644 --- a/Tools/nib2cib/NSButton.j +++ b/Tools/nib2cib/NSButton.j @@ -269,8 +269,6 @@ var NSButtonIsBorderedMask = 0x00800000, _highlightsBy = [cell highlightsBy]; _showsStateBy = [cell showsStateBy]; - [self setTag:[cell tag]]; - return self; } diff --git a/Tools/nib2cib/NSControl.j b/Tools/nib2cib/NSControl.j index a2ee25a75..5db1eeff3 100644 --- a/Tools/nib2cib/NSControl.j +++ b/Tools/nib2cib/NSControl.j @@ -56,6 +56,11 @@ [self setLineBreakMode:[cell lineBreakMode]]; [self setFormatter:[cell formatter]]; + + // In IB, both cells and controls can have tags. + // If the control has a tag, that takes precedence. + if ([aCoder containsValueForKey:@"NSTag"]) + [self setTag:[aCoder decodeIntForKey:@"NSTag"]]; } return self;