开发者

Menu Options are not changing - cocoa

I am making a cocoa 开发者_JAVA技巧app where i have a menu - you can see the picture below - but the problem is when i click on any other option e.g; subtract, multiply or division, it don't get selected. What can be the issue?

Note: When i made the menu, i checked the state option of add to ON and rest of them were OFF.

Menu Options are not changing - cocoa


Unlike radio buttons, which are cells in an NSMatrix, there's no easy way to group a bunch of menu items together to get radio-button/checkbox-group functionality. You'll just have to handle this yourself in the action method for all of these menu items: Set the state of the chosen menu item (the action's sender) to on, and all of its neighbors to off.

I'd hope that a menu isn't the only way you're providing users to switch the active operator; the user should at least have buttons to use as well, and should be able to use their keypad if they have one. Don't forget to keep the states of the menu items and the buttons synchronized; you probably should hook all the operator menu items and all the operator buttons up to one action, and update all of them in response to any of them.

You can set tags for the buttons and menu items in IB and check the sender's tag in your code in order to tell which operator the user has selected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜