• 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
Re: problem with addTrackingRectangle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with addTrackingRectangle


  • Subject: Re: problem with addTrackingRectangle
  • From: Ivan Kourtev <email@hidden>
  • Date: Wed, 15 Feb 2006 11:02:39 -0500

On Feb 15, 2006, at 10:41 AM, Scott Thompson wrote:
On Feb 15, 2006, at 9:22 AM, Ivan Kourtev wrote:
Hello,
I am having a problem adding a tracking rectangle to a custom view -- I've overridden - resetCursorRects, and I am sending [self addTrackingRect:...] while in resetCursorRects. But I think the problem is that my custom view never actually receives any resetCursorRects messages (I checked and know this for a fact).

I think you want to call addCursorRect:cursor: instead of addTrackingRect:?

Thanks for the suggestions. That would be fine to try and experiment (although I really want a tracking and not a cursor rectangle). According to the documentation, however, addCursorRect:cursor: should also be sent _only_ while in resetCursorRects (identical to the Apple presribed behavior for addTrackingRect:owner:userData:assumeInside:) At any rate, under the current circumstances my resetCursorRetcs does not get sent so it doesn't matter what I do inside it.


I also overrode -invalidateCursorRectsForView: in my custom window class containing the custom view. I verified that the window receives invalidateCursorRectsForView messages just fine. Then why doesn't resetCursorRects get sent to my custom view?

I guess I am missing something here -- any suggestions?

You might need to call the "enableCursorRects" method of your window. You can check it's state with "areCursorRectsEnabled"

Well, that didn't do much either. No change.

Is it that resetCursorRects: would not get sent unless there are tracking rectangles registered already? But then where is the correct place to add the first tracking (or cursor) rectangle?

I experimented with two versions of invalidateCursorRectsForView: in my custom window class. Originally, I had

- (void)invalidateCursorRectsForView:(NSView *)aView {
    NSLog( @"in -invalidateCursorRectsForView:%@", aView );
    [super invalidateCursorRectsForView:aView];
}

When I changed it to

- (void)invalidateCursorRectsForView:(NSView *)aView {
    NSLog( @"in -invalidateCursorRectsForView:%@", aView );
    [self resetCursorRects];
}

resetCursorRects was sent to my custom view and everything started working properly afterwards. of course, I am *not supposed* to do that according to the docs?

-- ivan



Scott


_______________________________________________ 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
References: 
 >problem with addTrackingRectangle (From: Ivan Kourtev <email@hidden>)
 >Re: problem with addTrackingRectangle (From: Scott Thompson <email@hidden>)

  • Prev by Date: File System changes notifications
  • Next by Date: Re: problem with addTrackingRectangle
  • Previous by thread: Re: problem with addTrackingRectangle
  • Next by thread: Re: problem with addTrackingRectangle
  • Index(es):
    • Date
    • Thread