Cabbage Logo
Back to Cabbage Site

If-statement overrides widget value

Hello!

Currently having an issue where an if-statement overrides the visible()-value of a widget at start. The if-statement should run when I click on the button, but it seems to be running once at the start anyway (to my understanding).

I’m trying to make it start as grey color. Would appreciate it if someone looks at it and points out where I’ve done wrong :slight_smile:

OnOff Example.zip (1.8 KB)

Nevermind, fixed it by using inline if statements that @t_grey showed me in another thread.

chnset sprintfk("visible(%d)",gkSyncButton == 0 ? 1 : 0),"SyncOff"
chnset sprintfk("visible(%d)",gkSyncButton == 1 ? 1 : 0),"SyncOn"

Still, I wonder why the first doesn’t work :thinking:

1 Like