Being apprised of when NSStatusItem is hidden

前端 未结 1 1573
萌比男神i
萌比男神i 2020-12-09 21:17

I have an app which uses an NSStatusItem. On small screens there\'s not much space in the status bar. When a user switches to an application with a lot of menu

相关标签:
1条回答
  • 2020-12-09 21:57

    It's pretty smart of you to realize that when a status item is hidden, its window will be moved into the background.

    Now the notification you're looking for is: NSWindowDidResignKeyNotification (or NSWindowDidResignMainNotification depending on the context of your application)

    For a clear explanation about the difference between a key window and a main window, see this.

    0 讨论(0)
提交回复
热议问题