Re: Working around radio button grouphing behaviour in 10.8 SDK?
Re: Working around radio button grouphing behaviour in 10.8 SDK?
- Subject: Re: Working around radio button grouphing behaviour in 10.8 SDK?
- From: Graham Cox <email@hidden>
- Date: Sun, 03 Jul 2016 16:43:06 +1000
> On 3 Jul 2016, at 4:19 PM, Jo Meder <email@hidden> wrote:
>
> Hi,
>
> Sorry, I thought I’d said enough.
>
> From the 10.8 SDK onward radio buttons which have the same superview and action now all behave as if they’re part of one radio group. Prior to this each radio button was independent, it was just a button. You had to use an NSMatrix or something to get radio group behaviour.
>
> Our framework expects the radio buttons to be independent. You can choose to place them in a radio group and have the framework manage them, or you can manage them independently. Having AppKit manage them automatically short circuits our UI framework.
>
> The framework is C++ with an Objective-C back end on the Mac. There is one action set on radio buttons which basically hands off to the framework to do notifications and such.
>
> The radio buttons are always created programatically.
It should be a fairly simple matter to adapt the objective-C glue code to work with the modern arrangement. If this is being done within the C++ part of the framework, that seems like a violation of model-view-controller principles. Presumably you ultimately have a property which is “1-of-n selected”, and you set/get which one it is. You can easily map the radio button to that type of property by comparing the button’s object pointer or tag, whichever you find easiest.
Note that if you are observing this property in order to set which of the group is ON should not matter - the selected button might get set twice by doing that, but it’s always the same button, so it’s never seen.
Burying group selection behaviour deeper than the direct receiver of the buttons' actions is a mistake, IMO. The modern behaviour does make life a lot easier, in general.
—Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden