Skip to content

Commit

Permalink
Fix tag reading from IB
Browse files Browse the repository at this point in the history
Both controls and cells can have tags in IB, but Cappuccino has no cells. If the control has a tag, that takes precedence. Tag reading was moved to NSControl from NSView, since NSView does not have a tag in Cocoa.
  • Loading branch information
Aparajita Fishman committed Sep 28, 2012
1 parent 90d52a8 commit 8ff2a32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions AppKit/CPView.j
Expand Up @@ -3072,6 +3072,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",

[self _setupToolTipHandlers];
_toolTip = [aCoder decodeObjectForKey:CPViewToolTipKey];

if (_toolTip)
[self _installToolTipEventHandlers];

Expand Down
2 changes: 0 additions & 2 deletions Tools/nib2cib/NSButton.j
Expand Up @@ -269,8 +269,6 @@ var NSButtonIsBorderedMask = 0x00800000,
_highlightsBy = [cell highlightsBy];
_showsStateBy = [cell showsStateBy];

[self setTag:[cell tag]];

return self;
}

Expand Down
5 changes: 5 additions & 0 deletions Tools/nib2cib/NSControl.j
Expand Up @@ -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;
Expand Down

0 comments on commit 8ff2a32

Please sign in to comment.