Re: Re: Speaking of tracking rects...
Re: Re: Speaking of tracking rects...
- Subject: Re: Re: Speaking of tracking rects...
- From: "Michael Ash" <email@hidden>
- Date: Sun, 10 Sep 2006 16:19:54 -0400
On 9/10/06, Dave Budde <email@hidden> wrote:
> No, no, no, no, and also no. Did I mention no?
>
> The tracking rect tag that's returned from addTrackingRect:... is not
> documented to follow any behavior other than being unique. The system
> would be perfectly fine in returning 42, then 1000000, then -1, etc.
> By assuming they start at 3 and work up, you're relying on an
> implementation detail that could change at any moment.
>
> The correct way to figure out which tracking rect the mouse entered is
> to use the userData: argument of this method. Pass it something handy
> and identifying-like, then you can get it back out of the NSEvent when
> things come in and do something with it.
>
> Mike
Mike, thanks for that warning. I was talking about the
trackingNumber in NSEvent not the tracking tag assigned from
addTrackingRect. Sorry for the confusion. The trackingNumber
(according to the documentation) is an identifier for a tracking
rectangle, correct? My understanding is that it should be able to be
used reliably to figure out which tracking rect is being entered.
I don't really understand your post. The two numbers are one and the
same. When you call addTrackingRect:..., it returns a tag. That same
tag is what you get from [event trackingNumber]. You certainly can
compare the two to see which tracking rect is involved. What you can't
do is rely on them to start at 3, or increase sequentially, or follow
any other kind of rational sequence. The only thing you can rely on is
that they will be unique.
Mike
_______________________________________________
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