• 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: Programmatically closing a submenu (NSMenu)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Programmatically closing a submenu (NSMenu) (From: augusto callejas <email@hidden>)

  • Prev by Date: Re: Sanity Check
  • Next by Date: Re: Sanity Check
  • Previous by thread: Programmatically closing a submenu (NSMenu)
  • Next by thread: Re: static analyzer
  • Index(es):
    • Date
    • Thread