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)
| 444 | // If the descriptions contains a single object with no name, |
| 445 | // It should be specified the empty string to build this object. |
| 446 | func (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 |
| 461 | func (b *Builder) SetImagepath(path string) { |