Hide MAAttachedWindow when clicking outside

后端 未结 2 963
醉话见心
醉话见心 2020-12-16 08:15

I\'m using an MAAttachedWindow to display a custom window under a NSStatusItem in the Menubar. Everything works fine, but I can\'t find an easy way to hide it when the user

2条回答
  •  感动是毒
    2020-12-16 09:06

    You should be able to do this via the window's delegate method:

    - (void)windowDidResignKey:(NSNotification *)notification

    Set yourself as the window's delegate, and implement that to call through to your toggle method.

提交回复
热议问题