• 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
NSMatrix doesn't highlight correctly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • [SOLVED] NSMatrix doesn't highlight correctly
      • From: Michael Becker <email@hidden>
    • Re: NSMatrix doesn't highlight correctly
      • From: Eric Forget <email@hidden>
  • Prev by Date: problmes with "Graceful Application Termination"
  • Next by Date: Re: array problem
  • Previous by thread: Re: problmes with "Graceful Application Termination"
  • Next by thread: Re: NSMatrix doesn't highlight correctly
  • Index(es):
    • Date
    • Thread