Using code to set an OPTION button

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
jrarickGAec4d
Posts: 4
Joined: Mon Dec 05, 2011 5:32 pm

Using code to set an OPTION button

Post by jrarickGAec4d » Thu Feb 23, 2012 2:43 pm

How can I use LC to set the "ON" or "OFF" of an option button? I want to be able to show the user what preferences he/she has already set.

Thanks in advance!

Jack Rarick
Braintree Athletic Systems

spencer
Posts: 71
Joined: Mon May 09, 2011 3:01 pm

Re: Using code to set an OPTION button

Post by spencer » Mon May 07, 2012 3:47 am

Do you mean a Radio Button? If not, what platform are you talking about?

jjt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 15
Joined: Mon Mar 19, 2012 12:01 am

Re: Using code to set an OPTION button

Post by jjt » Tue May 08, 2012 4:16 am

If you mean an Option button ... as in a group of buttons that allow for one of many options to be set then it is:

mobGUItouch the long id of group "YourButtonName"
i.e.
mobGUItouch the long id of group "Option 3"


If you mean the On/Off toggle, then use:

switchSet "YourControlNameHere", "Status"
i.e.
switchSet "My Choice 1", "On"

--John


jrarickGAec4d wrote:How can I use LC to set the "ON" or "OFF" of an option button? I want to be able to show the user what preferences he/she has already set.

Thanks in advance!

Jack Rarick
Braintree Athletic Systems

Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Re: Using code to set an OPTION button

Post by Tester2 » Fri Jun 07, 2013 10:19 pm

Hey Jack,

Did you ever figure out how to get the On/Off iOS Switch button to work?

John's "switchSet" code example only works for me when in LiveCode developing.

When I try to use it in the simulator or on my device then nothing happens.

This is frustrating because if my user turns the button to "ON" then when they close and re-open the app the button will have reset to "OFF".

Thanks!

Post Reply

Return to “MobGUI”