static VerticalLayout* VerticalLayoutFromDef(ParsedMui& parsed, TxtNode* structDef) { CrashIf(!structDef->IsStructWithName("VerticalLayout")); VerticalLayoutDef* def = DeserializeVerticalLayoutDef(structDef); VerticalLayout* l = new VerticalLayout(); l->SetName(def->name); Vec<DirectionalLayoutDataDef*>* children = def->children; DirectionalLayoutData ld; for (size_t i = 0; children && i < children->size(); i++) { SetDirectionalLayouData(ld, parsed, children->at(i)); l->Add(ld); } FreeVerticalLayoutDef(def); return l; }