MCPcopy
hub / github.com/g3n/engine / buildVList

Function buildVList

gui/builder_panel.go:271–293  ·  view source on GitHub ↗

buildVList builds a gui object of type: VList

(b *Builder, am map[string]interface{})

Source from the content-addressed store, hash-verified

269
270// buildVList builds a gui object of type: VList
271func buildVList(b *Builder, am map[string]interface{}) (IPanel, error) {
272
273 // Builds list and set commont attributes
274 list := NewVList(0, 0)
275 err := b.SetAttribs(am, list)
276 if err != nil {
277 return nil, err
278 }
279
280 // Builds children
281 if am[AttribItems] != nil {
282 items := am[AttribItems].([]map[string]interface{})
283 for i := 0; i < len(items); i++ {
284 item := items[i]
285 child, err := b.build(item, list)
286 if err != nil {
287 return nil, err
288 }
289 list.Add(child)
290 }
291 }
292 return list, nil
293}
294
295// buildHList builds a gui object of type: VList
296func buildHList(b *Builder, am map[string]interface{}) (IPanel, error) {

Callers

nothing calls this directly

Calls 4

NewVListFunction · 0.85
SetAttribsMethod · 0.80
buildMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected