Adding Dynamic Child Objects to Widgets

Yes you can. But you can only add entire widgets dynamically, not create widget components (the stuff in the list in the Designer view).

For example, if you want to dynamically add text boxes to a vertical box:

  1. Create a widget and put a Text Box in it. This will be the widget that you create dynamically later.
  2. In the widget that contains the Vertical Box, do Create Widget and pick the widget at Step 1.
  3. Get a reference to your Vertical Box and do Add Child.
  4. Connect the output from the Create Widget into the Add Child node.
  5. Add the output from the Create Widget node into an array so you can access it later.

You can do this with anything that can contain more than 1 child, like Horizontal/Vertical boxes, scroll boxes, etc.

3 Likes