VERY INTERESTING!!!
:D

G.

On Dec 31, 2009, at 2:25 PM, Andreas Mayer wrote:

> 
> Am 31.12.2009 um 00:09 Uhr schrieb Ken Thomases:
> 
>> There is no mouse-up event.  He wants to present a menu if there's been X 
>> time since the mouse-down even when _no other events have arrived since 
>> then_.  There's no getting around using a timer of some sort.
> 
> That's a case for -performSelector:withObject:afterDelay: (which obviously 
> uses a timer of some sort)
> 
> - (void)mouseDown:(NSEvent *)theEvent
> {
>       // send openMenu: to self after 0.8 seconds
>       [self performSelector:@selector(openMenu:) withObject:nil 
> afterDelay:0.8];
> }
> 
> - (void)mouseUp:(NSEvent *)theEvent
> {
>       // user released mouse button - cancel previous perform request
>       [NSObject cancelPreviousPerformRequestWithTarget:self 
> selector:@selector(openMenu:) object:nil];
> }
> 
> (Typed in Mail.app)
> 
> 
> Andreas
> _______________________________________________
> 
> 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/gustavxcodepicora%40gmail.com
> 
> This email sent to gustavxcodepic...@gmail.com

_______________________________________________

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