Do tracking rectangles move along with their views?
Do tracking rectangles move along with their views?
- Subject: Do tracking rectangles move along with their views?
- From: Ken Tozier <email@hidden>
- Date: Fri, 22 Apr 2005 21:24:57 -0400
I'm getting some squirrely tracking rectangle behavior in a custom view in which the location of subviews can change depending on the containing view width and height. Is it necessary to void all old tracking rectangles and create new ones every time a subview changes location? If you have hundreds of subviews (which my class could easily have) having to void everything every time the window changes by even a pixel seems awfully wasteful.
Also having trouble figuring out what to supply to NSView's "addTrackingRect:toView:owner:userData:assumeInside:" method.
What type of rect are you supposed to feed this method? The subview frame translated to window coordinates? Containing view coordinates? I've tried both and when I manually draw the view rect using NSFrameRect() the resultant rectangles either never appear, are in the lower left corner of the window or appear below and to the left of where the subview appears in the containing view. The documentation isn't very clear on whether it expects the absolute position within the window coordinates or what it's looking for.
I read the NSView documentation, looked at some example code and read tech note which says you can't define tracking rectangles til after they are added to a view, but am still having problems with it.
Thanks for any help
Ken |
_______________________________________________
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