views:

72

answers:

1

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?

A: 

I don't know how to do it in Cocoa, but you could maybe use the Carbon function PopUpMenuSelect.

JWWalker
Thanks, but I need to avoid Carbon. Also, I believe PopUpMenuSelect is deprecated.
Daniel Jette