I want to use a NSButton configured to show only an image in my NSToolbarItem
. The item is created in IB and the code to add the button to it is:
NSButton *button = [[NSButton alloc]init];
[button setImage:[NSImage imageNamed:@"StarEmpty"]];
[button setAlternateImage:[NSImage imageNamed:@"StarFull"]];
[button setImagePosition:NSImageOnly];
[button setBordered:NO];
[self.toolbarItem setView:button];
The problem is that when i click on the image instead of the alternate image a lighter background is shown. I link the image to explain the problem.
This is the normal state and it's ok
This is when i click on it (and not rise the left mouse button)
Can anyone tell me how to fix that? thanks!