I have a similar case, and it works OK.

What I do is on mouseDown, start a timer. When that fires, it grabs [NSApp 
currentEvent] and passes that as the event to the popUpContextMenu: method. The 
menu tracks as expected.

The only kink was that because this was being done within a button cell's 
tracking, I had to post a fake mouse UP after the menu was closed to ensure 
that the cell ended tracking. For a view that may not be necessary unless 
you're doing something special on mouse up.

--Graham




On 27/10/2011, at 5:23 PM, Ryan Joseph wrote:

> I have a menu that I popup using popUpContextMenu:withEvent:forView: from a 
> mouse down event but after a delay (like a dual-state click and hold button). 
> The problem is when I release the mouse button the menu is closed forcing the 
> user to hold the mouse down the entire time they're navigating the menu. 
> 
> Is there anyway to keep the menu open after the mouse is up? The event I used 
> was manually created which I thought was correct since the mouse down event 
> has been ended when the menu was opened from the timer. Using various kinds 
> of event kinds for mouse down events didn't help the problem.
> 
> Thanks for any ideas you may have.
> 
> Regards,
>       Ryan Joseph
>       thealchemistguild.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/graham.cox%40bigpond.com
> 
> This email sent to graham....@bigpond.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