# Drawables and Value Trees

**URL:** <https://forum.juce.com/t/drawables-and-value-trees/8294>\
**Category:** General JUCE discussion\
**Created:** [March 8, 2012, 11:11pm UTC](https://forum.juce.com/t/drawables-and-value-trees/8294 "2012-03-08T23:11:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack\_anderson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jack_anderson/32/737_2.png) [@jack\_anderson](https://forum.juce.com/u/jack_anderson)\
**Post date:** [March 8, 2012, 11:11pm UTC](https://forum.juce.com/t/drawables-and-value-trees/8294/1 "2012-03-08T23:11:41Z")

</div>

Last night i was diving into the capability of using ValueTrees to rebuild drawables, but for some reason, when I did it, the ComponentBuilder object seemed to be angry about component ids not being there and so on.  
I dont have my code here with me at work so I cant post it at the moment, but was hoping someone might be able to shed some light on the subject.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 9, 2012, 9:47am UTC](https://forum.juce.com/t/drawables-and-value-trees/8294/2 "2012-03-09T09:47:32Z")

</div>

Yes, you’d need to give all your drawables a unique ID before you convert them to a ValueTree for that to work. I’ve got some work in the pipeline that’ll make use of all that stuff, but not ready for the public yet…

---

<div class="post-metadata">

**Author:** ![jack\_anderson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jack_anderson/32/737_2.png) [@jack\_anderson](https://forum.juce.com/u/jack_anderson)\
**Post date:** [March 9, 2012, 6:29pm UTC](https://forum.juce.com/t/drawables-and-value-trees/8294/3 "2012-03-09T18:29:08Z")

</div>

ah ok… how do I give them the id? also… nice new picture 😉

---

<div class="post-metadata">

**Author:** ![jack\_anderson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jack_anderson/32/737_2.png) [@jack\_anderson](https://forum.juce.com/u/jack_anderson)\
**Post date:** [March 9, 2012, 7:56pm UTC](https://forum.juce.com/t/drawables-and-value-trees/8294/4 "2012-03-09T19:56:51Z")

</div>

Nevermind. it’s probably Component::setComponentID(); Is it going to work if I try it?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 9, 2012, 8:58pm UTC](https://forum.juce.com/t/drawables-and-value-trees/8294/5 "2012-03-09T20:58:17Z")

</div>

> [@](#):
>
> Is it going to work if I try it?

Probably!
