comboBox and referTo() ValueTree

hi there,
haw can I bind a ComboBox to a ValueTree with some Children.
F.E:
ValueTree
names
name value=“someName1”
name value=“someName2”
name value=“someName3”

so the combo box displays and reacts to changes in the ValueTree with referTo() and has the items:
someName1
someName2
someName3
thanks!

There’s the AudioProcessorValueTreeState::ComboBoxAttachment class for doing this for plug-in parameters which it might be worth looking at, but it’s not very clear what you mean from your post - could you post some code to clarify what you’re trying to achieve?

thanks! it is kinda of what I’m looking for. but I don’t want to use an AudioProcessor.
so I’m trying to referTo() a common ValueTree. but I’ll look on how it’s implemented in the AudioProcessorValueTreeState::ComboBoxAttachment.
greets

I wrote something alike here:

But there is also ComboBox::getSelectedIdAsValue() to do:

auto& value = tree.getPropertyAsValue ("combo", nullptr);
combo.getSelectedIdAsValue().referTo (value);

thanks! I’ll look into your implementation.