Re: Context Menu and first responder targets

2023-03-05 Thread Eyal Redler via Cocoa-dev
Thanks Graham, To explain the context, this menu pops out from a custom view in a toolbar item and needs to target the selection in the window so I can't wire it directly to the actual target since it is dynamic. Using the information you supplied, I was able to make this work by passing the c

Re: Context Menu and first responder targets

2023-03-05 Thread Graham Cox via Cocoa-dev
Hi Eyal, I believe the target for a pop-up menu is the view that you pass in that method, at least initially. If there is an established responder chain from that view to other responders (up to and including First Responder) then the menu items should reach their target. But it’s pretty easy t

Context Menu and first responder targets

2023-03-05 Thread Eyal Redler via Cocoa-dev
Hi, I'm using popUpContextMenu:withEvent:forView: to show a context menu. The menu contains several items whose target is the first responder (that is, nil). But the items are not enabled and if I turn off autoEnable then the action is never called on the first responder. Same target/action