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

Function buildHList

gui/builder_panel.go:296–318  ·  view source on GitHub ↗

buildHList builds a gui object of type: VList

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

Source from the content-addressed store, hash-verified

294
295// buildHList builds a gui object of type: VList
296func buildHList(b *Builder, am map[string]interface{}) (IPanel, error) {
297
298 // Builds list and set commont attributes
299 list := NewHList(0, 0)
300 err := b.SetAttribs(am, list)
301 if err != nil {
302 return nil, err
303 }
304
305 // Builds children
306 if am[AttribItems] != nil {
307 items := am[AttribItems].([]map[string]interface{})
308 for i := 0; i < len(items); i++ {
309 item := items[i]
310 child, err := b.build(item, list)
311 if err != nil {
312 return nil, err
313 }
314 list.Add(child)
315 }
316 }
317 return list, nil
318}
319
320// buildDropDown builds a gui object of type: DropDown
321func buildDropDown(b *Builder, am map[string]interface{}) (IPanel, error) {

Callers

nothing calls this directly

Calls 4

NewHListFunction · 0.85
SetAttribsMethod · 0.80
buildMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected