How to get the on-screen location of an NSStatusItem

To do this without the hassle of a custom view, I tried the following (that works). In the method that is set as the action for the status item i.e. the method that is called when the user clicks the status item, the frame of the status item can be retrieved by:

[[[NSApp currentEvent] window] frame]

Works a treat for me


Give the NSStatusItem a view, then get the frame of that view's window. This technically counts as UndocumentedGoodness, so don't be surprised if it breaks someday (e.g., if they start keeping the window offscreen instead).

I don't know what you mean by “could not get heigher then 20px”.