• 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: Making efficient use of tracking rects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making efficient use of tracking rects


  • Subject: Re: Making efficient use of tracking rects
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 05 Mar 2005 09:29:16 -0800

On Fri, 4 Mar 2005 16:22:06 -0800, Christopher Drum
<email@hidden> said:
>I'm looking through the documentation, and I don't see anything that
>addresses this question that's nagging me. I can set up tracking rects
>and I can set up tool tip rects. These things work just fine. But, is
>it possible to reference one of these rects on something like
>mouseDown: in an NSView subclass? I'd love to be able to get the
>userData for the tracking rect that my mouse click intersects. I
>suppose I could just make up a dictionary to send through the userData
>that includes the rect and my own information, but it seems so
>redundant to package up a rect in the userData for that same rect.
>
>I guess what I want to be able to do is, in mouseDown: call
>[NSTrackingRectIntersectsPoint(NSPoint) userData]. i.e., give me the
>userData information for the tracking rect which my current mouse down
>coordinates intersect.
>
>It seems like a lot of redundant information would be useful to package
>up into the userData, like the tag, the rect, app-specific data, etc.
>At the same time, it seems difficult to grab some of this info if it
>isn't immediately put into the userData at the moment of rect creation.
>
>Or do I have this all confused?

If you have a tracking rect, then at the time the mouse goes down within it,
you *already* know that the mouse is within it, because you received a
mouseEntered: for that tracking rect (and you never received the
corresponding mouseExited: for it). m.


--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
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

  • Prev by Date: Re: -[NSSet initWithSet:copyItems:] crashing
  • Next by Date: Re: -[NSSet initWithSet:copyItems:] crashing
  • Previous by thread: Making efficient use of tracking rects
  • Next by thread: Outlets not allowing direct access...
  • Index(es):
    • Date
    • Thread