Highlighting a NSMenuItem with a custom view?

前端 未结 4 1737
抹茶落季
抹茶落季 2020-12-25 14:08

I have created a simple NSStatusBar with a NSMenu set as the menu. I have also added a few NSMenuItems to this menu, which work fine (

4条回答
  •  既然无缘
    2020-12-25 14:38

    If you're adding a view to a menu item, that view has to draw the highlight itself. You don't get that for free, I'm afraid. From the Menu Programming Topics:

    A menu item with a view does not draw its title, state, font, or other standard drawing attributes, and assigns drawing responsibility entirely to the view.

提交回复
热议问题