Buttons in my project (latest official TD build and previous one) don’t always seem to match their value on project startup.
The example below shows my ‘armed’ button in red but with a value of ‘off’. The background colour is tied to panel.state as per default panel button. If you toggle the button then it’s fine.
The button value is bound to a custom parameter on another COMP.
Many thanks in advance!
If I recall correctly @Ivan mentioned that the parameter Value0 should be handled as the source of truth and panelVale for buttons should be considered depricated.
Yes, panelValues are user interactions. The value0 parameter is the actual data held by the button.
Thanks both. This is the default colouring logic that comes when the button is placed when adding as a new COMP. Would be good to change that to reflect this behaviour.
I think I’ll switch everything over to Widgets now!
Oh hey! I missed that in your first post. Can you send your file with instructions on where to find the button please? Post here or send to email@example.com
Here we go Ivan. Parameter is set during startup which might be what throws things. Seems like the button state hangs over from saving and then doesn’t update when bound value is set before user interaction.
ButtonIssue.toe (4.7 KB)
Yeah that’s a bug right there! Will get that fixed for future releases. I’ll also share the solution I come up with here in case you decide you want to use it.
Great stuff, thanks Ivan!
I’m still finding my feet with UI stuff in TD. Think I need to migrate my buttons over to widgets really. On my list for this project next week now.
Here is a button that doesn’t have the problem. Changed the expressions to use par.value0 instead of panel.state.
button.tox (1.4 KB)
This is probably how buttons in future builds will work.
Thanks Ivan, guessed as much! I think it’s time to go widget anyway now, futureproof!