Re: NSButton/NSBox interaction
Re: NSButton/NSBox interaction
- Subject: Re: NSButton/NSBox interaction
- From: Graham Cox <email@hidden>
- Date: Thu, 10 Apr 2014 09:30:31 +1000
On 10 Apr 2014, at 7:06 am, Tom Doan <email@hidden> wrote:
> have a dialog which has an NSBox. Inside the NSBox are two
> (separate, but conceptually linked) sets of radio buttons. These are
> just NSButtons with radio style---I haven't (at least intentionally)
> embedded them into an NSMatrix. However, when I select one of
> the buttons from one set, it resets all others in both sets to off so
> somehow it's automatically interpreting <<all>> the buttons inside
> the box as a single collection even though that's not my intention.
> However, I can't see anything in the description of either NSButton
> or NSBox that seems to cover this behavior so I can override it. Can
> someone explain what's happening, please?
I'm not exactly certain of the mechanism, but I think radio buttons interact as a set through the agency of their immediate superview, so if several buttons share it, they are assumed to be part of the same set.
So you can embed the separate sets into container views or NSMatrix, and they'll work as you want. You mention NOT putting them into a NSMatrix for some reason - what reason? That's the usual way to set up radios, though it comes with the added restriction that the buttons have to be laid out on a regular grid. But embedding them in a custom view that draws nothing should also work, and that has no such limitation.
--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