IDBUX: Radio Menu Items

 

Windows Radio Menu   Mac Radio Menu

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:

  1. Create a “Bullet” image to perfectly match the feel of the Check image used by the system.
  2. Add add several NSMenuItems to your menu.
  3. Send -setOnStateImage: to each NSMenuItem that will be part of the radio group.
  4. 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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值