Highlighting weirdness in an NSMatrix
Highlighting weirdness in an NSMatrix
- Subject: Highlighting weirdness in an NSMatrix
- From: Michael Becker <email@hidden>
- Date: Wed, 3 Mar 2004 10:38:46 +0100
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.