Switch off radio buttons?

Discuss Lemur and share techniques.
Post Reply
iPad_User
Regular
Posts: 50
Joined: 09 Jan 2012 16:57

Switch off radio buttons?

Post by iPad_User »

Hey folks,

okay... this should be an easy thing... but I'm sitting in front of my computer like an idiot.

I have some switches in my layout which are in "radio-mode".
I added an expression:

Code: Select all

selTab=show(Container, firstoff(x))
By pushing one of those buttons the container next to it changes his tab.

What I now want to achieve is, that the container hides completely if I press the radio-button again (and if the radio-buttons turns off would also be nice).

Anybody? :-)

Thanks!
Chris
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: Switch off radio buttons?

Post by Phil999 »

it seems not so simple to me. Pressing the lit radio button again normally results in nothing. Maybe it is better to have a different button to make the container vanish?

If the primary idea with the radio buttons is important, there should be some methods possible. For example, when a button is lit, an invisible Canvas object is moved there, and if you hit that Canvas object, it sets the button array to 0 and vanishes back outside the interface. And hides the container.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
iPad_User
Regular
Posts: 50
Joined: 09 Jan 2012 16:57

Re: Switch off radio buttons?

Post by iPad_User »

Hey!

Thanks for your answer.
It's not necessary, that the lit radio-button is pressed again. I'm cool with a separate "reset"-button.

Do you have any ideas regarding the code?

Thanks,
Chris
Phil999
Regular
Posts: 919
Joined: 11 Jan 2012 01:53

Re: Switch off radio buttons?

Post by Phil999 »

I would try with Switches.x=0. If that doesn't work try Switches.x=fill(0,0,n). n is the number of switches.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
iPad_User
Regular
Posts: 50
Joined: 09 Jan 2012 16:57

Re: Switch off radio buttons?

Post by iPad_User »

Phil999 wrote:I would try with Switches.x=0. If that doesn't work try Switches.x=fill(0,0,n). n is the number of switches.
Thanks! I already tried that. It disables all buttons. But the container is still visible and doesn't disappear...
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

Re: Switch off radio buttons?

Post by MrCorba »

If you don't mind having an extra button it's as easy as adding a second expression to the switches.

Let's say you've got 3 tabs and 4 switches. You just add this expression to the switches for tab changing:

Code: Select all

selTab=selecttab(Container,firstof(x)-1)
And this expression for hiding it with the first button:

Code: Select all

showContainer=show(Container,firstof(x))
The container is only shown when the first button is pressed, because then show will have a value of less then 1 which means it's invisible. And the other three buttons show the tabs.
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
iPad_User
Regular
Posts: 50
Joined: 09 Jan 2012 16:57

Re: Switch off radio buttons?

Post by iPad_User »

Yeyyyyy....

great! That's working!
In my case it would be nicer to have the last one enabling / disabling the container...

Hmmmm..... :-)
MrCorba
Regular
Posts: 142
Joined: 02 Sep 2013 20:17
Location: Netherlands

Re: Switch off radio buttons?

Post by MrCorba »

just change the expressions to:

Code: Select all

selTab=selecttab(Container,firstof(x))
and:

Code: Select all

showContainer=show(Container,3-firstof(x))
with 3 being the number of the last switch, so if you have 5 switches the 3 would become 4.

It now subtracts the firstof of the number of switches and only comes to zero when the firstof equals the number
"Having no silence in music is like having no black or white in a painting" - Brian Eno
https://soundcloud.com/mrcorba
iPad_User
Regular
Posts: 50
Joined: 09 Jan 2012 16:57

Re: Switch off radio buttons?

Post by iPad_User »

Awesome! Perfect :-)

Thanks !!
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Switch off radio buttons?

Post by Softcore »

There is a way to pull this off, using Pads as pseudo-switches - no need for the extra button this way. ;)
Attachments
Container&pseudoSwitches.jzml
(3.99 KiB) Downloaded 89 times
Post Reply