> On 8 Apr 2016, at 8:44 PM, Graham Cox <graham....@bigpond.com> wrote: > > Off the top of my head I can imagine how this code would look and with due > respect to Sean, it would be a lot less complicated than RRRadioBinder.
OK, here’s what I had in mind. Super simple, tested and works, though I ran into one small difficulty - it’s hard to tell given an NSButton instance whether it’s a radio button. There’s no -buttonType property and the bezel type returned isn’t the ‘circular’ style as you might expect so I’m not sure what unique set of properties imply a radio. For now, I just assume that ALL NSButton subviews of the group are radio buttons, which is not unreasonable. Also, for 10.8+, the button highlighting will be done twice - once by this code and once by NSView’s default implementation. It’s harmless, the user doesn’t see it, and the -selectedIndex property is only changed once, but if it bothers you you could add in some conditionals based on OS version. —Graham
GCRadioGroupView.h
Description: Binary data
GCRadioGroupView.m
Description: Binary data
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com