NSSatusItem gets hidden if Application menu to large

108 Views Asked by At

Possible Duplicate:
Being apprised of when NSStatusItem is hidden

I'm currently working on a small Mac OS X app, that displays text in the status bar. I'm using a NSStatusItem with variable length if that helps.

The problem I'm seeing is, that when the menu of an active App is to large, it will hide the status items from right to left.

Here's enough space available to display my status item

If I now switch to another App that has a larger menu, my status item get's hidden as you can see in this screenshot.

Not enough space left to display my status item

I already tried to adjust the text length by subscribing to the NSWindowDidMoveNotification as suggested here, but it only fires once and my code to adjust the length of the text did not have any effect.

My question is: Is there any other notification that I could listen for to adjust my status item?

Thanks in advance!

Update: Let me add that my App is an Agent App that is not displayed in the Dock while running if that makes a difference.

0

There are 0 best solutions below