4
votes

My application uses NSStatusItem to be visible to the user. So I set 'Application is agent (UIElement)' to YES, which basically hides the menu bar of the application, and hides the icon from the dock. Now, I didn't delete the menu bar, so I can still react to shortcuts like cmd+W to close the preference window, or cmd+q to quit the application. The problem is, that anytime I use such a command, the menubar get's messed up. I've noticed that other Apps which run in the background, like Growl 2, have the same issue.

Menubar graphics error

I have no idea how to fix this. Hopefully someone of you can help me

I'm running Mountain Lion.

thanks!

HINT

It probably has something to do with the 10.8 SKD. I have never noticed this issue before in any application.

1
What? NSToolbarItem? Did you mean NSStatusItem? - TheAmateurProgrammer
Please edit the title as well. - Kevin Grant
What happens if you remove the NSMenu? I presume that the shortcuts won't work, but does the visual bug disappear? Can you use a different object in the responder chain to handle the shortcuts? - Benedict Cohen
Yes, the bug does not occur, but I don't want to be having to handle the shortcuts in every window/view. - IluTov

1 Answers

1
votes

How about move the whole Window menu to be Application menu submenu and then hide it? You will still receive shortcuts and the highlited menu will be the application menu that is by anyway there (i suppose so, how else you will open preferences window? also shortcut?).