NSMatrix doesn't highlight correctly
NSMatrix doesn't highlight correctly
- Subject: NSMatrix doesn't highlight correctly
- From: Michael Becker <email@hidden>
- Date: Thu, 11 Mar 2004 14:40:06 +0100
Hello!
I have an NSMatrix of NSImageCells and I want to be able to select the
cells, so I set the NSMatrix to be an NSListModeMatrix. Because I don't
want to use the bordered NSImageCells and because the unbordered
NSImageCells don't highlight, I subclassed NSImageCell.
Actually everything works fine, except for the highlighting. The cells
seem to highlight only if the mouse interacts with them directly. For
example, if I want to select the cells "by rectangle", all the cells
that the mouse hovers over get highlighted, but not the other cells,
which are also selected.
These cells DO actually all get selected correctly. My problem is
merely about the graphical highlighting.
Currently I am (only) doing this:
- (void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)controlView
{
if ([self isHighlighted] && ([ self image] != nil)) {
[[NSColor selectedControlColor] set];
NSRectFill (frame);
} else {
[[NSColor whiteColor] set];
NSRectFill (frame);
}
[super drawInteriorWithFrame:frame inView:controlView];
}
What am I missing here?
Regards,
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.