Mailing Lists: Apple Mailing Lists

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

Highlighting weirdness in an NSMatrix



Hi!

i have an NSMatrix in list mode. I use subclasses of NSImageCell to display images. In my cell-subclasses I implemented a highlighting-mechanism but it doesn't work the way it should. Here is the code I added to the NSImageCell-subclass:

- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)controlView
{
if ( [ self isHighlighted] && ( [ self image] != nil )) {
[[NSColor selectedControlColor] set];
NSRectFill (frame);
}
[super drawInteriorWithFrame:frame inView:controlView];
}

This works fine as long as I select single cells. And if I drag the mouse across a couple of cells, these get highlighted nicely, too.

But, e.g., if I shift-click to select a range, only the first and last cell get highlighted (although I actually _do_ select the complete range as my NSLogs() show :-)). Or when I have selected several cells by dragging the mouse across them, and then click on any other cell, the last cell gets highlighted but the formerly highlighted cells partially still remain highlighted.

Please note that in my case "highlighted" is really not "selected". Everything works nicely except for the visual highlighting.

What is going on?

- Michael
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




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.