2

I am currently instantiating an NSMatrix w/ NSButtonCell subclasses through IB

I use the identity inspector to change the Tool Tip property

enter image description here

But the tooltip doesn't show on the button cell.

If I set a tooltip on the NSMatrix object, a tooltip still doesn't show

If I add an NSButton to the same view, and add a tooltip to that, it does show

Why won't my tooltips on NSMatrix or NSButtonCell show?

Community
  • 1
  • 1
A O
  • 5,516
  • 3
  • 33
  • 68

2 Answers2

3

I don't know why it can not be set in the Interface Builder (It seems like a long standing issue), but you can set them at least programmatically.

[self.matrix setToolTip:@"Tooltip for first item" forCell:[self.matrix cellAtRow:0 column:0]];
[self.matrix setToolTip:@"Tooltip for second item" forCell:[self.matrix cellAtRow:1 column:0]];
1024jp
  • 2,058
  • 1
  • 16
  • 25
0

Careful, if in InterfaceBuilder you click the button, you can add the tooltip to the button, and the class displayed under "Custom Class", top right, is NSButton. But, if you click the button again, as you do while selecting stuff in xcode, what is selected is the NSButtonCell, which appears to have a separate tooltip. If you're not careful you add your tooltip to the NSButtonCell instead of the NSButton, and it won't show in your running application.

So, the problem may be that you have clicked the button one more time in IB, and you thought to enter the tooltip for the NSButton, but you didn't.

Personally I think it may be a bug, why would you want to add a tooltip for the button cell?

RickJansen
  • 1,615
  • 18
  • 24