开发者

NSStatusItem not shown after sleep

开发者 https://www.devze.com 2022-12-21 22:19 出处:网络
I\'ve got a small Cocoa problem. I have a StatusBar application that has an NSStatusItem in the Menu Bar. It is drawn by a custom View as shown here. When the Main view of the 开发者_开发知识库app is

I've got a small Cocoa problem. I have a StatusBar application that has an NSStatusItem in the Menu Bar. It is drawn by a custom View as shown here. When the Main view of the 开发者_开发知识库app is hidden (most of the time), the computer goes to sleep and awakens again, I lose the icon and a blue rectangle is shown. Has anyone of you got any idea what I can do about it. It doesn't happen when the Main View is shown.


The problem was fixed by replacing [theItem drawStatusBarBackgroundInRect:[toolbarView frame]] to [toolbarView setNeedsDisplay:YES]; Thanks AlBlue for getting me in the right direction.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号