Best way to make a button disappear after click

Hey very new to TD and its starting to make more sense but my coding background wants to pop up constantly and mess with my way of thinking through problems.

But wondering what is the best way to have a Button disappear after it has been clicked. I know that you need to some how manipulate the display value from 1 to 0.

Is there a way to easily have lets say a select chop at connected to something that will always display the opposite value ie. 1 in select, 0 in connected chop and vice versa. Thanks for any help in advance!

The best way is to probably use a Panel Execute DAT that will run a script when the button is pressed. In that script you would do something like
opparm button1 display ( 0 )

to turn off the Display parameter. Using CHOPs with exports probably isn’t the best in this case since you could end up with a endless dependency chain with the state of the button’s parameters depending on the state of the button’s panel values (which in turn depend on the parameter values to decide their behavior)

Awesome worked perfectly thanks a bunch!

Ok well one more question for the day related to buttons and scripting. I want a button to display after a certain value from a count. That part works fine. but after using lets call in a reset button for the app.

I need to reset the count back to zero but not start up yet. and when i call a opparm -c count1 reset it will auto start the count back up again which wont work with what I am trying to do.

The other way I think this will also work is to write a script that will detect the current value of a buttons paneldisplay. But every time I have attempted to do this i merely get the string back. Is there a way to get this value at all?

All good I found that I was doing an infinite loop in part which was came to the problem. But someone please let me know if your able to do a get on an objects parameters please! Was not able to find one or within the Tscript commands

You’ll want to look at the expressions list. Commands perform actions, expressions fetch values. In this case you want to use the par() expression.

oh nice huge help my syntax was a bit off

So me and the buttons seem not to be getting along at all over the past few days. Any idea why a button would not be active in the top level component viewer? It shows up but I am not able to actively use it. if I go into the container and hit the button through the viewer active the buttons work just as they are intended to but not through the main viewer. Has me a bit perplexed.

I have two containers that feed into a switch and to an out which goes to the top viewer. The first container and all of its buttons work fine but once it switches down to the second container to run that part of the app none of the buttons work at all. do I have to do something to the container once I switch between the two?

It’s likely there is another container covering the button, but it has no content so it’s transparent.

Ok well after removing the container with the actives from my project and feeding the second container straight into the top out. the buttons worked. So I guess my overall question would be can you use containers that have buttons link the containers together at a switch and feed the output to a TOP out and somehow get it all pieces to work correctly or is better to build it all in the same container and just be really organized in it :laughing: . (main reason i attempted to do it using the containers)

whether it is better to put things in the same container really depends on what you are building and how you want to organize it. if you have multiple containers occupying the same position what you can do is make sure that only the container in use has the Panel->Display parameter set to 1.

Selina

The more and more I play around with this environment the more I like it. Thank you very much for the suggestion I got it to work another way but I like your idea alot more. Much cleaner!