Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check box on NSToolBar won't update?

I have a Check Box on a tool bar, (NSToolbar) as in the image below. It's action gets called and the sender.state toggles with each push, but on the tool bar the box never gets checked.

So the expected behaviour in terms of toggling, and the Action being called are all as you'd expect, it's just that the check box never redraws with the box checked.

I have tried setting sender.setNeedsDisplay=YES in the action, but that made no difference.

All the other controls on the tool bar work as expected.

Any ideas? enter image description here

like image 237
Kenny Avatar asked Feb 19 '14 15:02

Kenny


2 Answers

Try embedding the checkbox in a NSBox which you configure to be borderless and transparent. worked for me --- button type should be checkbox

like image 97
Sandeep Kodan Avatar answered Sep 30 '22 07:09

Sandeep Kodan


Try embedding the checkbox in a NSBox which you configure to be borderless and transparent. As sadly so often for NSToolbarItems, this strategy works.

like image 28
Elwisz Avatar answered Sep 30 '22 06:09

Elwisz