I donβt think there is a supported way to do this without using the Accessibility framework to simulate a click on your status element. Regardless, it is probably not advisable to abuse the menu in this way.
The Spotlight menu bar item does not use NSMenu, it uses its own window / view. You can consider this route if you have some kind of custom view to display.
Rob keniger
source share