Using onValue to respond to OSC messages?

Basically what I want is to change the background colour of a panel by sending an OSC message to it, I've tried various things in the onValue bit but can't get it to actually do anything at all? This is what I'd expect to work

onValue:
setVar("this" , "colorBg", value)

Not really sure what I'm doing wrong, it's like the onValue is never triggering at all, I tried putting a console.log() in the onValue on a textbox and it triggered ok, does this just not work with panels? Even with the textbox I couldn't get setVar to work with anything I tried?

panel widgets have a value only in the following cases:

  • if they have scrollbars (value = scrollbars position as a [x,y] array)
  • if they contain tabs (value = active tab index)

You should create a script widget in that panel and use it to receive the messages and execute that script, this way you won't bother with the specifics of panel values.

setVar doesn't change a property directly, you need to use the VAR{} syntax in property and then call setVar to change the value returned by that VAR{} statement.

1 Like

Ah I understand it now, managed to do what I wanted, thanks for the help!