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

Method Build

gui/builder.go:446–458  ·  view source on GitHub ↗

Build builds a gui object and all its children recursively. The specified name should be a top level name from a from a previously parsed description If the descriptions contains a single object with no name, It should be specified the empty string to build this object.

(name string)

Source from the content-addressed store, hash-verified

444// If the descriptions contains a single object with no name,
445// It should be specified the empty string to build this object.
446func (b *Builder) Build(name string) (IPanel, error) {
447
448 // Only one object
449 if name == "" {
450 return b.build(b.am, nil)
451 }
452 // Map of gui objects
453 am, ok := b.am[name]
454 if !ok {
455 return nil, fmt.Errorf("Object name:%s not found", name)
456 }
457 return b.build(am.(map[string]interface{}), nil)
458}
459
460// SetImagepath Sets the path for image panels relative image files
461func (b *Builder) SetImagepath(path string) {

Callers

nothing calls this directly

Calls 1

buildMethod · 0.95

Tested by

no test coverage detected