• 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
NSButtonCell in NSTableView doesn't receive setHighlighted:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSButtonCell in NSTableView doesn't receive setHighlighted:


  • Subject: NSButtonCell in NSTableView doesn't receive setHighlighted:
  • From: Sebastian Morsch <email@hidden>
  • Date: Sat, 5 Jan 2008 15:24:33 +0100

Hi,

I just found out that an NSButtonCell that sits in an NSTableView doesn't receive the setHighlighted: message from the table when it's displayed for a selected row. In the case of NSImageCell and NSTextFieldCell it DOES happen, they both receive that message from the table's preparedCellAtColumn:row: method.

I couldn't find an answer to this in previous posts.

I worked around this by subclassing NSTableView and overriding that method to make sure all cells get the setHighlighted:

- (NSCell *)preparedCellAtColumn:(NSInteger)column row:(NSInteger)row
{
	NSCell* cell = [super preparedCellAtColumn:column row:row];

	[cell setHighlighted:(row == [self selectedRow])];

	return cell;
}


It's not a big deal of course, but since setHighlight: is a superclass method from NSCell it seems strange to me that the table doesn't treat all cells equally. Is this expected behaviour or is it worth filing a bug?



Sebastian _______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSButtonCell in NSTableView doesn't receive setHighlighted:
      • From: "Ken Ferry" <email@hidden>
  • Prev by Date: Re: How to limit number of CPU cores used by a Cocoa app
  • Next by Date: Re: thread protocol modifiers
  • Previous by thread: Re: How to limit number of CPU cores used by a Cocoa app
  • Next by thread: Re: NSButtonCell in NSTableView doesn't receive setHighlighted:
  • Index(es):
    • Date
    • Thread