Reading the list archives a little more, it looks like there may be two ways to do this:

- _NSHighlightCarbonMenu and _NSUnhighlightCarbonMenu are SPIs which take an NSMenu* and do exactly what you'd expect - You can add a fake temporary menu item to your menu, with a suitably bizarre key equivalent and no target or action. Then use NSMenu -performKeyEquivalent: to simulate its selection.

Wow, great choices here :| I'm going to try #2 first since it's not SPI. I'll inform the list of the results.


John Stiles wrote:
John Stiles wrote:
Randall Meadows wrote:
On Apr 17, 2008, at 11:54 AM, John Stiles wrote:
As previously explained here, I'm handling hotkeys in my app via custom code in order to work around some AppKit bugs.

How can I simulate the menu-title blink effect using Cocoa? In Carbon, it's FlashMenuBar(menuID) but I don't see a Cocoa equivalent.

NSMenuView's -performActionWithHighlightingForItemAtIndex:?

(Never used it, just looked it up...)
This is at the top of the file:

Note: NSMenuView is deprecated and is no longer used to draw menus. Calling its methods will not affect the appearance of your menus.

I don't think this will work. Actually I don't think there is even a way to get a valid NSMenuView* at all.
For the curious, I tried the next best thing—NSMenu's -performActionForItemAtIndex: —and this API does not appear to simulate the menu blink, although it arguably should.

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to