开发者

NSMenuItem's NSView not highlighting in submenu

I have an NSStatusItem that displays an NSMenu full of NSView subclasses. I override drawRect: in my NSView subclass to implement highlighting in the NSMenu and everything works fine in the root menu, but for some reason it doesn't work in submenus of the root menu. I put some NSLog statements in my NSView subclasses drawRect: and noticed that it's not even being called for the views in the submenu. Any ideas?

I can post the code that 开发者_如何学PythonI'm using to highlight the views, but I don't think that its necessary since drawRect: is not even being called. Let me know if there's any other code you need to see that might help.


Could you use NSMenuItem's setEnabled method to sort of jog the submenuItems awake?


The problem seems to have resolved itself. I might have just forgot to set the view to use my NSView subclass.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜