Tracking Rect Documentation clarification please
Tracking Rect Documentation clarification please
- Subject: Tracking Rect Documentation clarification please
- From: Jim Correia <email@hidden>
- Date: Wed, 21 Sep 2005 16:19:03 -0400
<http://developer.apple.com/documentation/Cocoa/Conceptual/
BasicEventHandling/Tasks/HandlingMouseTracking.html>
The documentation says:
Tracking rectangles, though created and used by NSViews, are
actually maintained by NSWindows. Because of this, a tracking
rectangle is a static entity; it doesn’t move or change its size
when the NSView does. If you use tracking rectangles, you should be
sure to remove and reestablish them any time you change the frame
rectangle of the NSView that contains them. If you’re using a
custom subclass of NSView, you can override the frame- and bounds-
setting methods to do this. You can also register an observer for
the NSViewFrameDidChangeNotification, and have it reestablish the
tracking rectangles on receiving the notification.
As far as I can tell, this is correct but incomplete. You also have
to remove and re-establish your tracking rectangles anytime your
superview moves, or its superview moves, etc. Overriding the bounds
setting methods, or listening for NSViewFrameDidChangeNotification
isn't going to help here.
What is the recommended solution to the problem?
It appears that -resetCursorRects is called at all the appropriate
times. Besides the object that the method isn't named
resetTrackingRects, is there any reason why I shouldn't just
reestablish my tracking rects here?
Thanks,
Jim _______________________________________________
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