ValueTreeState Query

Hi I am wondering how I can get my custom sliders to change size/bounds when their parameters are adjusted? Do I need to have some kind of listener set up in the Editor ? Cheers

Yes, there is a ValueTree::Listener class (see the tutorial on how to use it here).

It’s not difficult: your slider needs to derive from ValueTree::Listener and then override the necessary functions (most importantly valueTreePropertyChanged(). Then you need to add a listener to the ValueTree using ValueTree::addListener().

Note that the listener is stored by ValueTree object itself–not the underlying data structure. This means that the ValueTree you’re listening to goes out of scope, the listening will stop. The normal solution is to have a ValueTree member variable inside the same class as the listener, and then add the listener to that.

Definitely difficult for newcomers like myself ! But I finally got there so thanks for the help :slight_smile: