How Can I get a Value print in a Label using a Button?

If you require help or assistance with anything then please post here

Moderators: electrogear, exonerate

How Can I get a Value print in a Label using a Button?

Postby distante on Sun Apr 15, 2012 1:03 am

I'm trying (for a couple of hours now) to make a label change his value when I push a bottom

For Example, I have the a button with the Text "65hz", so, I want to change a Label to "65Hz" when I puss this button, but I can't figure out what combination of primitives or modules do I have to use, I tried the String Switch without success... :(

A pointer?

Cheers
Sorry If I don't make myself clear sometimes, my English sucks!
User avatar
distante
essemist
 
Posts: 138
Joined: Thu Mar 15, 2012 4:22 pm

Re: How Can I get a Value print in a Label using a Button?

Postby cyto on Sun Apr 15, 2012 1:53 am

Here are a couple different ways. The first toggles between two values. The second "sends" a value to the label. Are either of these what you had in mind?

switch.png
switch.png (41.57 KiB) Viewed 490 times

labelSwitch.osm
(589 Bytes) Downloaded 39 times

-cyto
User avatar
cyto
essemilian
 
Posts: 317
Joined: Sun Nov 28, 2010 4:36 am
Location: CIN | OH | USA

Re: How Can I get a Value print in a Label using a Button?

Postby ChrisHooker on Sun Apr 15, 2012 2:02 am

Grrr.... Cyto beat me to the punch. Oh well, here's another example using the String Switch method which incorporates buttons such as you described in your question.

Basically, it's probably the trigger that was getting you hung up, I bet?
Attachments
String Switch.osm
(3.82 KiB) Downloaded 43 times
ChrisHooker
essemist
 
Posts: 141
Joined: Fri Mar 26, 2010 6:32 pm
Location: Loudon, TN

Re: How Can I get a Value print in a Label using a Button?

Postby distante on Sun Apr 15, 2012 2:48 pm

Yeap the trigger was what I wasn't able to understand!

Thank you cito and Chris! Now I have see how can change labels with buttons/triggers

Cheers!!

:D
Sorry If I don't make myself clear sometimes, my English sucks!
User avatar
distante
essemist
 
Posts: 138
Joined: Thu Mar 15, 2012 4:22 pm

Re: How Can I get a Value print in a Label using a Button?

Postby distante on Sun Apr 15, 2012 7:17 pm

Chris,

I'm using your example for assign a value to a module string using a button, I copied and Paste your buttons but for some reason they aren't showed in the top module, any ideas why?

edit:

The "show in parent" option is active btw.
Last edited by distante on Sun Apr 15, 2012 7:29 pm, edited 1 time in total.
Sorry If I don't make myself clear sometimes, my English sucks!
User avatar
distante
essemist
 
Posts: 138
Joined: Thu Mar 15, 2012 4:22 pm

Re: How Can I get a Value print in a Label using a Button?

Postby ChrisHooker on Sun Apr 15, 2012 7:24 pm

Yeah, sorry about that - I had the wireless link named to something for the schematic I was using the buttons in. Just rename/delete the name of the wireless View transmitter in each button. That should fix ya up.
ChrisHooker
essemist
 
Posts: 141
Joined: Fri Mar 26, 2010 6:32 pm
Location: Loudon, TN

Re: How Can I get a Value print in a Label using a Button?

Postby distante on Sun Apr 15, 2012 7:31 pm

Oh! I didn't knew that changing the name of the wireless link this can happen.

Thank you ;)
Sorry If I don't make myself clear sometimes, my English sucks!
User avatar
distante
essemist
 
Posts: 138
Joined: Thu Mar 15, 2012 4:22 pm

Re: How Can I get a Value print in a Label using a Button?

Postby ChrisHooker on Sun Apr 15, 2012 8:33 pm

Something else I just realized - I made these buttons starting from the stock "Push Button" module from the toolbox, which doesn't include any preset features. If you want that capability, you'll need to modify accordingly.
ChrisHooker
essemist
 
Posts: 141
Joined: Fri Mar 26, 2010 6:32 pm
Location: Loudon, TN

Re: How Can I get a Value print in a Label using a Button?

Postby distante on Sun Apr 15, 2012 8:55 pm

Not really, I'm using this buttons for do a Play/Pause/Stop Buttons for the Wave Player module, I just added on more button for the "initialization".

I need to ask other thing now hehehe!

:D Cheers!
Sorry If I don't make myself clear sometimes, my English sucks!
User avatar
distante
essemist
 
Posts: 138
Joined: Thu Mar 15, 2012 4:22 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 2 guests