Re: Hit-testing in custom NSCell in NSTableview
Re: Hit-testing in custom NSCell in NSTableview
- Subject: Re: Hit-testing in custom NSCell in NSTableview
- From: Ricky Sharp <email@hidden>
- Date: Fri, 06 Oct 2006 12:56:16 -0500
On Friday, October 06, 2006, at 11:47AM, Glen Simmons <email@hidden> wrote:
>Yes, except for getting that information out to the world. When an
>NSActionCell sends its action message, there's no extra information,
>just the control that contains it. Also, the cell isn't involved at
>all for a right-click.
You could always do something like this...
* add a 'clickedImageIndex' ivar to your cell; also expose at least a getter in your control to obtain that ivar.
* when a mouse click is received by your control (you'll need to override mouseDown if not already), 'clear' the cell's clickedImageIndex (maybe set to -1)
* in your code that determines which image in the cell was actually hit, set that as the clickedImageIndex.
* In your action handler (where you have the control), ask the control for the clickedImageIndex.
I did something similar to this for a multi-cell control.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden