add-gadget ( parent child -- parent )
Factor handbook » UI framework » Building user interfaces » Gadget hierarchy and layouts » Layout basics

Next:unparent ( gadget -- )


Vocabulary
ui.gadgets

Inputs
parenta gadget
childa gadget


Outputs
parenta gadget


Word description
Adds a child gadget to a parent. If the gadget is contained in another gadget, unparent is called on the gadget first. The parent will be relayout.

Notes
Adding a gadget to a parent may result in graft* being called on the children, if the parent is visible on the screen.

Side effects
Modifies parent

Definition