Tinderbox Forum

Create prototype off of composites

Hi all,

As the title says, can I quickly generate composites from a prototype?


Turn the question around: “can I make a composite into a prototype?” The answer is no. “Can the composited notes have the same or different prototypes?” Yes.

So, you can generate a composite “Apple Pie” whose two notes have prototypes “Fruit” and “Crust”, individually. Then you can make a new instance of the “Apple Pie” composite and one of that instance’s two notes will have the “Fruit” prototype and the other the “Crust” prototype.

So, “can I quickly generate composites from a prototype”. No. But you can quickly add a composite from a previously defined composite. (The “Apple Pie” composite needs to be located in /Composites, as you know.)

Composites and prototypes are two separate concepts.


The preceding is absolutely correct. There is a possible solution (just tested) if you are happy that the composite is a child of the note using a prototype. This occurs because when a note is given a prototype the note also inherits, by default**, the prototype’s children and these can include composites.

My test used the built-in ‘list’ composite as a child of my test prototype. When a note was then set to use that prototype the note gained a list composite, the composite’s items being children of the note. This method can’t be used to make a composite that is a sibling of the note.

** see more on prototypes ‘bequeathing’ their children.

Well, yes and no. Yes, because the note you to which you assign the prototype (with its composited children) does indeed itself gain a child “composite”. But this doesn’t work like “normal” compositing. Let’s say you have made the “Apple Pie” composite I mentioned above. And you make that “Apple Pie” composite into a child of a note “Desert”, and finally make “Desert” into a prototype. You can, as suggested, assign the “Desert” prototype to another note. But in this case, the composited child it gains that way is no longer an “Apple Pie” composite. It looks like it is, but doesn’t inherit the “Apple Pie” name and a few other attributes.

[… after re-learning how to bequeath prototyped children…]


File is here: Protocomposite1.tbx (76.3 KB)

I’m not sure if this does exactly what the OP wants, but I think it’s as close as we can get. I’ve reported the non-naming of bequeather composites, I suspect that issue isn’t intentional and will likely get fixed.

Ah, silly me — somehow I totally missed how named composites can be created (by putting them under /Composites container), but that’s exactly what I needed. I just wanted a quick way to create a group of notes with different shapes and colors while maintaining their relative positions. For some reason, I thought I had to go the prototype route…

Thanks for your help and effort!

1 Like