• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Darn Radio button question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Darn Radio button question


  • Subject: Darn Radio button question
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 29 Mar 2016 13:43:49 +1100

G’day once more scriptures.

Writing once again in frustration.

I’ve created the group of three radio buttons, but individually, not as a matrix.

The Tool Tips for the radio buttons now says…

For a single choice among mutually-exclusive options.

For apps running on 10.8 and later, creating radio groups with individual NSButton objects (rather than an NSMatrix) is preferred.

Radio buttons automatically act as a group (selecting one button will unselect all other related buttons) when they have the same superview and -action method.

So, I did, but even thought I’m using the same handler to switch the buttons (and it works), I cannot work out how to get the set values for whichever of the three is set.

Binding the first one to a matrix property does not work. And Shanes Explored does not seem to cover this updated requirement.

If I have to resort to using a matrix, how can I convert a single button instance to a matrix of three buttons?

ATM I’ve tried binding each button to a property, but clicking any button always responds as thought the first button is clicked.

on resetTextLineReplace:sender
try
# No matter which button is clicked, the response is always 'replace'
if sender is radioSelectButtonOne then set my textLineReplace to "replace"
if sender is radioSelectButtonTwo then set my textLineReplace to "before"
if sender is radioSelectButtonThree then set my textLineReplace to "after"
on error errmsg number errnum
my thereHasBeenAnError("resetTextLineReplace", errmsg, errnum, 0, 0)
end try
say textLineReplace as text
my fordEvent()
end resetTextLineReplace:




 _______________________________________________
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

  • Follow-Ups:
    • Re: Darn Radio button question
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Compiling error question.
  • Next by Date: Re: Compiling error question.
  • Previous by thread: Re: Compiling error question.
  • Next by thread: Re: Darn Radio button question
  • Index(es):
    • Date
    • Thread