Setting tooltips for a NSMatrix
Setting tooltips for a NSMatrix
- Subject: Setting tooltips for a NSMatrix
- From: Stephan Burlot <email@hidden>
- Date: Tue, 14 Dec 2004 15:36:51 +0100
Hi,
I have a problem while setting tooltips on a NSMatrix (of NSImageCells,
iPhoto like):
I do iterate over all cells in my Matrix: if the cell has the attribute
dpiIsTooLow, I set the toolTip to "dpiIsTooLow", if not, I set it to
"OK".
Problem is that if I change the tooltips using the method below, it
doesnt change on the screen. The old toolTip is still displayed when I
mouse over. I have to resize my window (and this will call other
methods not discussed here) to make it appear correctly.
Other problem found while trying to debug this is that the call
[pixMatrix toolTipForCell:matrixCell] will return (null), but I can see
on the scren that the tooltip is not empty.
Any ideas?
Stephan
- (void) rebuildToolTips
{
NSEnumerator *enumerator;
CMCell *matrixCell; // subclass of NSImageCell
MARK(1);
enumerator = [[pixMatrix cells] objectEnumerator];
while (matrixCell = [enumerator nextObject])
{
if (![matrixCell transparent])
{
NSLog(@"matrixCell %@ has originally tooltip: %@",
[matrixCell title],
[pixMatrix toolTipForCell:matrixCell]);
if ([matrixCell dpiIsTooLow])
{
NSLog(@"Image %@ has dpiTooLow", [matrixCell title]);
[pixMatrix setToolTip:@"dpiTooLow" forCell:matrixCell];
NSLog(@"matrixCell %@ has now tooltip: %@",
[matrixCell title],
[pixMatrix toolTipForCell:matrixCell]);
}
else
{
NSLog(@"Image %@ has NOT dpiTooLow", [matrixCell title]);
[pixMatrix setToolTip:@"OK" forCell:matrixCell];
}
}
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden