Re: Programmatically closing a submenu (NSMenu)
Re: Programmatically closing a submenu (NSMenu)
- Subject: Re: Programmatically closing a submenu (NSMenu)
- From: Eric Schlegel <email@hidden>
- Date: Thu, 08 Jul 2010 08:42:03 -0700
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 (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