
What happens when I select “List”?
Here’s a truly rare bird: a UI heuristic where most GUI toolkits get it right,but Apple (Cocoa) goes horribly wrong. In the above example,what will happen when “List” is selected? On the Mac (right),It’s not clear,is it? Will “List” also become checked,or will “Large Icons” become unchecked?
In virtually all pull-down menu implementations across all platforms,there are basically three types of functionality for any menu item (which does not have a submenu,and is not a separator):
Standard Item CheckBox Item Radio Item
The Standard item is handled perfectly well in Cocoa. You click it,the menu closes,its function is performed.
Similarly,a CheckBox-style item works just fine in Cocoa. You click it to turn something on. It gains a checkmark indicator,and something is on. You click it again,checkmark goes away,and something is off. Cocoa even supports a “mixed” state,which displays a dash in front of the item.
However,there is no built-in way to handle a Radio-style group of menu items in Cocoa. In order to properly implement a group of radio items in a Cocoa menu,you have to do four things:
Create a “Bullet” image to perfectly match the feel of the Check image used by the system. Add add several NSMenuItems to your menu. Send-setonStateImage: to each NSMenuItem that will be part of the radio group. Implement the controller logic or binding magic to keep only one item in the “on” state. Other toolkits — including GTK+,Swing,and windows — have methods of creating menu item radio groups,and use a different symbol,just as forms do,to differentiate checkBoxes from radio items. To be sure,this is one of the precIoUs few glaring omissions I’ve ever seen in the AppKit toolBox since I started with it in 1993; however,that makes it no less BUG-worthy.
It’s time for Apple to appropriate one more feature from its competition. I Demand Better User ExperIEnce.
http://www.nibfile.com/blog/?p=34
总结以上是内存溢出为你收集整理的IDBUX: Radio Menu Items全部内容,希望文章能够帮你解决IDBUX: Radio Menu Items所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)