• 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: Showing a menu after a delay...?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing a menu after a delay...?


  • Subject: Re: Showing a menu after a delay...?
  • From: Eric Schlegel <email@hidden>
  • Date: Mon, 01 Feb 2010 20:18:44 -0800

On Feb 1, 2010, at 2:08 PM, Eric Gorr wrote:

> performSelector:withObject:afterDelay: will only perform the selector after a delay after the mouse button goes up. I had actually tried doing this manually with the code
>
> NSTimer *mouseStillDownTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(mouseStillDown:) userInfo:NULL repeats:NO];
> NSRunLoop	*currentRunLoop = [NSRunLoop currentRunLoop];
>
> [currentRunLoop addTimer:mouseStillDownTimer forMode:NSDefaultRunLoopMode];
>
> when I first noticed the timers (which performSelector:withObject:afterDelay relies upon) don't fire until after the mouse button goes up.

That's probably because you're installing the timer in the default runloop mode. While the mouse is down, AppKit is tracking the mouse using NSEventTrackingRunLoopMode. Try using that mode (or possibly , NSRunLoopCommonModes) instead.

-eric

_______________________________________________

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

References: 
 >Showing a menu after a delay...? (From: Eric Gorr <email@hidden>)
 >Re: Showing a menu after a delay...? (From: Richard Penwell <email@hidden>)
 >Re: Showing a menu after a delay...? (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: Showing a menu after a delay...?
  • Next by Date: Re: NSDocument "save as" bug
  • Previous by thread: Re: Showing a menu after a delay...?
  • Next by thread: Re: Showing a menu after a delay...?
  • Index(es):
    • Date
    • Thread