• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Highlighting weirdness in an NSMatrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Dynamic cursor rectangles?
  • Next by Date: __MyCompanyName__ in templates
  • Previous by thread: How to get mouse moved events from sheet window
  • Next by thread: __MyCompanyName__ in templates
  • Index(es):
    • Date
    • Thread