On Jul 7, 2010, at 4:20 PM, augusto callejas wrote:

> hi-
> 
> i have an NSMenu that has another NSMenu as a submenu (via an NSMenuItem).
> in a certain situation, when the submenu is visible, i want to close that 
> submenu, but without closing the main NSMenu.
> the documentation for [NSMenu cancelTracking] says it dismisses the menu, but 
> when i call that on the submenu,
> it dismisses the submenu but also the main NSMenu.
> 
> how can i only close a submenu without affecting the main menu?


There is no way to do that using Carbon or Cocoa API. You might be able to 
trick the menu system into closing the submenu by posting a left arrow 
keydown/keyup pair to the event queue - I haven't tried that, and it would be 
fragile.

-eric

_______________________________________________

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