• 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
mouseMoved: or multiple trackingRects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mouseMoved: or multiple trackingRects?


  • Subject: mouseMoved: or multiple trackingRects?
  • From: "Richard Pollock" <email@hidden>
  • Date: Wed, 8 Aug 2007 23:28:29 +0100

Dear list,

I have a custom NSView that displays a DNA sequence (a string
containing the letters A,T,C and G) horizontally with letter spacing
controlled by an NSSlider. I've managed to implement mouse tracking
such that a vertical bar (extending to the full height of the view)
follows the mouse left and right along the view using mouseMoved:
inside a trackingRect covering the whole view.

However, I'd now like it to "snap" to each of the letters in the
sequence. I could continue using mouseMoved: and only show the box at
certain positions, but I wondered whether using a trackingRect for
every letter in the sequence would work better (using mouseEntered:
and mouseExited: for each one to highlight it).

Has anyone tried either of these methods and, if so, what were your
experiences? Would having up to ~200 trackingRects in the view present
any obvious problem? Googling "multiple tracking rects/mouseMoved:"
hasn't thrown up anything obvious...

Many thanks,
Rich
_______________________________________________

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

  • Follow-Ups:
    • Re: mouseMoved: or multiple trackingRects?
      • From: Jon Hull <email@hidden>
    • Re: mouseMoved: or multiple trackingRects?
      • From: Lee Ann Rucker <email@hidden>
    • Re: mouseMoved: or multiple trackingRects?
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Loading data in a background thread and displaying it with Bindings
  • Next by Date: RE: Cocoa and messages to nil, revisited
  • Previous by thread: Re: Loading data in a background thread and displaying it with Bindings
  • Next by thread: Re: mouseMoved: or multiple trackingRects?
  • Index(es):
    • Date
    • Thread