Re: Preventing highlight of RowSelection in

On Mar 27, 2009, at 10:53 AM, Jerry Krinock wrote:

On 2009 Mar 27, at 04:40, Sourabh Sahu wrote:

How can we prevent the highlight feature , when we select row in NSTableView.
I also want to shouldSelectRow return YES.

I believe this will do what you want:

If you're building for Leopard only, subclass NSTableView so that this method is a no-op:

- (void)highlightSelectionInClipRect:(NSRect)clipRect {

This should work on tiger too. You also should subclass your cells and make sure they don't draw any highlighting by overriding this and returning nil:

- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;

There is no need to override the private methods; people frequently make that wrong assumption. Granted, the whole process could be made better if there was an easy option to do this on NSTableView.



Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

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

Help/Unsubscribe/Update your Subscription:

This email sent to maillists@xxxxxxxxx