I have a view that needs to be refreshed after a period of mouse inactivity.

- (void)mouseInactive
{
    // This does not work.
    [self setNeedsDisplay:YES];
    
    // This does not work. I think this did work at one time but stopped
    // working on OS X 10.10 Yosemite.
    [self performSelector:@selector(setNeedsDisplay:)
               withObject:@YES afterDelay:0.0];
}

- (void)mouseMoved:(NSEvent *)event
{
    [NSObject cancelPreviousPerformRequestsWithTarget:self];
    [self performSelector:@selector(mouseInactive)
               withObject:nil afterDelay:2.0];
}

The problem is that calling setNeedsDisplay: does not work. It appears that the 
run loop is stopped. Once the user does something like press a key on the 
keyboard then the view is refreshed.

Does anyone have any ideas?

--Richard Charles


_______________________________________________

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

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

Reply via email to