I have a project that needs to disable/enable some NSToolbarItems depends on different options. I checked and found no parameter for this.
Is there a way to enable/disable a given NSToolbarItem?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Implement NSToolbarItemValidation Protocol in your window, view or document controller. The documentation gives the following sample code:
You can also use
actionortagto determine what toolbar item is being validated. Items are validated frequently, whenever your app is activated or events are dispatched, so they will always be in a valid state.