I can get the menu handle from CreateNibReference function, but I don’t know how to hide or disable menu item with the handle in Mac OS X?
Share
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.
It sounds like you’re using the Carbon Menu Manager. In that case, if you have a
MenuRefinstance, you callDisableMenuItem(), passing the index of the menu item, to disable a menu item:As expected, call
EnableMenuItem()to enable the item again.As far as I am aware, there is no way to ‘hide’ a menu item with the Carbon Menu Manager. The closest thing I can think of would be removing a menu item, in which case you would use
DeleteMenuItem():See Apple’s Menu Manager documentation for more detailed information on how to use these functions.
Also, as a side note, it is generally advisable to use Cocoa instead of Carbon for most applications. Carbon is being visibly phased out by Apple, and it might not be long before Apple deprecates it entirely.