Looking for popUpMenuPositioningItem:atLocation:inView: equivalent for 10.5

Posted by Daniel Jette on Stack Overflow See other posts from Stack Overflow or by Daniel Jette
Published on 2010-02-04T22:26:44Z Indexed on 2010/04/05 19:23 UTC
Read the original article Hit count: 383

Filed under:
|
|
|

I'm working on an application that needs to display a context menu on screen in various scenarios. In the function I'm writing, I don't have access to any NSWindows or NSViews. I'd like to use popUpMenuPositioningItem:atLocation:inView as this function works perfectly for me in 10.6. However, we have a requirement to support 10.5, so this function isn't available to me.

The feature I'm most interested in, as stated in the documentation is:

If view is nil, the location is interpreted in the screen coordinate system. This allows you to pop up a menu disconnected from any window.

Basically, I need to display the context menu given a location on screen, but without any associated view.

Is there any way to achieve this on 10.5?

© Stack Overflow or respective owner

Related posts about nsmenu

Related posts about cocoa