Re: AppleScriptObjC Explored 5, radio buttons
Re: AppleScriptObjC Explored 5, radio buttons
- Subject: Re: AppleScriptObjC Explored 5, radio buttons
- From: Phil Stokes <email@hidden>
- Date: Sat, 23 Sep 2017 21:56:31 +0700
Not sure I can still post to this list, Jim, but I think if you connect two or
more radio buttons to the same target action, you’ll get the same behaviour as
the old NSMatrix class gave. Give them different tags if you need to
differentiate between them in code.
The docs say:
Use of NSMatrix is discouraged in apps that run in macOS 10.8 and later. If you
need to create a radio button group in an app that runs in macOS 10.8 and
later, create instances of NSButton
<https://developer.apple.com/library/content/technotes/tn2219/_index.html#//apple_ref/doc/uid/DTS10004624-CH1-SUBSECTION12>
that each specify a button type of NSRadioButton and specify the same action
and the same superview for each button in the group.
I don’t know how to do that with bindings (generally I steer clear of bindings
as there’s too much voodoo going on under the hood that I can’t control).
Best
Phil
@sqwarq
> On 23 Sep 2017, at 21:44, Jim Weisbin <email@hidden> wrote:
>
> I’m working my way through AppleScriptObjC Explored 5. I know that it’s out
> of date, but there’s a lot of great stuff to learn about in there. I’ve been
> able to build a lot of the projects using Xcode 9, but the one that stumps me
> is the very first one, using radio buttons. They’ve changed the way that
> radio buttons work, and are no longer using NSMatrix. The information I’ve
> gleaned so far seems to be that if you drag in a bunch of radio buttons and
> bind them to the same property, they should act as a button group. But I
> haven’t been able to get that to work - when clicking on one, they all
> activate, and the action sent is “true”, not the button label. Any help would
> be appreciated. Thanks.
>
> Jim Weisbin | C.T.O. | Human | Post Human | 27 West 20th Street | Suite 801 |
> New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | 2046 Broadway |
> Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com
> <http://www.humanworldwide.com/>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> applescriptobjc-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden