Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting tooltips for a NSMatrix



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.