"Arrange in Front" menu item and iterating over menus
"Arrange in Front" menu item and iterating over menus
- Subject: "Arrange in Front" menu item and iterating over menus
- From: "email@hidden" <email@hidden>
- Date: Tue, 5 May 2009 11:25:57 -0700
if i iterate over all the menu items in the main menu bar in
NSApplication's delegate method: applicationDidFinishLaunching, then
i don't find the menu item for "Arrange in Front" (an alternate for
"Bring All to Front") for the Window menu.
if i either click on the Window menu (in the main menu bar) or type a
menu item keyboard shortcut and then iterate over all menu items,
"Arrange in Front" now is found.
i sorta/kinda understand this as "Arrange in Front" is apparently
added automatically by the app kit framework, and isn't really there
until one of the above actions has occurred. (see below stack trace.)
but... i would like to find it at applicationDidFinishLaunching time.
i've been able to solve this for the time being by using the SPI
-[NSMenu _populate:], but we all know how dangerous this is! :-)
can anyone suggest a better/"legal" way to have "Arrange in Front"
show up when iterating over menu items at
applicationDidFinishLaunching time?
thanx,
ken
ps. does anyone think this is a "radar worthy" bug?
#0 0x00d74ecb in -[NSMenuItem setAlternate:]
#1 0x00edd1a6 in -[_NSWindowMenuUpdater menuNeedsUpdate:]
#2 0x00edcc30 in -[NSMenu _populate:]
#3 0x00edcb5a in AppKitMenuEventHandler
#4 0x025e9143 in DispatchEventToHandlers
#5 0x025e857d in SendEventToEventTargetInternal
#6 0x025e83e2 in SendEventToEventTargetWithOptions
#7 0x0262cff9 in SendMenuPopulate
#8 0x02641f23 in SendMenuOpening
#9 0x02641b2f in DrawTheMenu
#10 0x0264190f in MenuChanged
#11 0x0264076a in TrackMenuCommon
#12 0x0263c383 in MenuSelectCore
#13 0x0263bed7 in _HandleMenuSelection2
#14 0x0263bd4b in _HandleMenuSelection
#15 0x00e1950b in _NSHandleCarbonMenuEvent
#16 0x00d8026a in _DPSNextEvent
#17 0x00d7f630 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#18 0x00117e2e in -[KVApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] at
KVApplication.mm:306
#19 0x00d7866b in -[NSApplication run]
#20 0x00d458a4 in NSApplicationMain
#21 0x00002abe in main at main.m:12
_______________________________________________
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