• 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
Refresh View After Mouse Inactivity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Refresh View After Mouse Inactivity


  • Subject: Refresh View After Mouse Inactivity
  • From: Richard Charles <email@hidden>
  • Date: Sat, 30 Apr 2016 17:08:16 -0600

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 (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Refresh View After Mouse Inactivity
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: undomanger performance
  • Next by Date: Re: Refresh View After Mouse Inactivity
  • Previous by thread: Re: undomanger performance
  • Next by thread: Re: Refresh View After Mouse Inactivity
  • Index(es):
    • Date
    • Thread