• 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
Re: Hit-testing in custom NSCell in NSTableview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Hit-testing in custom NSCell in NSTableview (From: Glen Simmons <email@hidden>)
 >Re: Hit-testing in custom NSCell in NSTableview (From: Mike Abdullah <email@hidden>)
 >Re: Hit-testing in custom NSCell in NSTableview (From: Glen Simmons <email@hidden>)

  • Prev by Date: FSAllocateFork
  • Next by Date: NSArrayController bindings -- duplicate data?
  • Previous by thread: Re: Hit-testing in custom NSCell in NSTableview
  • Next by thread: print name of a constant
  • Index(es):
    • Date
    • Thread