Re: mouseMoved: or multiple trackingRects?
Re: mouseMoved: or multiple trackingRects?
- Subject: Re: mouseMoved: or multiple trackingRects?
- From: Jon Hull <email@hidden>
- Date: Wed, 8 Aug 2007 17:55:32 -0700
I would go with mouseMoved: because trackingRects can get tricky when
scrolling is involved.
Thanks,
Jon
On Aug 8, 2007, at 3:28 PM, Richard Pollock wrote:
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
_______________________________________________
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