Correct way to use images in NSMenuItem?

I placed several images next to NSMenuItems using the image option in Interface Builder. The custom image is a simple PNG. I was hoping that the system would automatically change the color of the image during the mouse, as happens with still frames. Is not. What am I doing wrong?

Here is a stock image compared to my usual:

compare

+4
source share
1 answer

In the code, call [menuItem.offStateImage setTemplate:YES]

+7
source

Source: https://habr.com/ru/post/1389204/


All Articles