On Jul 18, 2011, at 04:59, Gabriel Roth wrote:

> Thanks for the corrections. But changing the line in question to
> 
>      myTrackingArea = [[NSTrackingArea alloc]
> initWithRect:self.blueView.bounds
> options:(NSTrackingMouseEnteredAndExited |
> NSTrackingActiveInActiveApp | NSTrackingInVisibleRect ) owner:self
> userInfo:nil];
> 
> doesn't change the puzzling behavior when attempting to re-add the
> tracking area.

Try it this way:

-(IBAction)addTrackingArea:(id)sender
{
        NSAssert (!myTrackingArea, @"Gotta remove the old one first");

        myTrackingArea = [[NSTrackingArea alloc]
                initWithRect:self.blueView.bounds
                options:(NSTrackingMouseEnteredAndExited | 
NSTrackingActiveInActiveApp | NSTrackingInVisibleRect ) 
                owner:self
                userInfo:nil];

        [self.blueView addTrackingArea:myTrackingArea];
}

-(IBAction)removeTrackingArea:(id)sender
{
        if (!myTrackingArea)
                return;
        
        [self.blueView removeTrackingArea:myTrackingArea];
        myTrackingArea = nil;
}


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to