Re: Cells selection in NSTableView
Re: Cells selection in NSTableView
- Subject: Re: Cells selection in NSTableView
- From: Dado Colussi <email@hidden>
- Date: Fri, 17 Jul 2009 09:54:02 +0200
>
> I need following functionality to be implemented in NSTableView.
> "Selecting Multiple cells of single column in
> NSTableView".
>
> I subclassed NSTableView and created class TestTableView.
>
> I have done following 3 things.
>
> ...
> 3) I created custom class for NSTextFieldCell and overriden following
> method
>
> - (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView
> *)controlView
> {
> return nil;
> }
Do not override -highlightColorWithFrame:inView:. Instead, override
-setHighlighted: and -setBackgroundStyle: with empty
implementations. Then override -drawWithFrame:inView:, and determine whether
the cell (center point) is inside any selected cell rectangle. If yes, then
-[super setHighlighted:YES], otherwise -[super setHighlighted:NO].
/Dado
_______________________________________________
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