buildWindow builds a gui object of type: Window
(b *Builder, am map[string]interface{})
| 594 | |
| 595 | // buildWindow builds a gui object of type: Window |
| 596 | func buildWindow(b *Builder, am map[string]interface{}) (IPanel, error) { |
| 597 | |
| 598 | // Builds window and sets its common attributes |
| 599 | win := NewWindow(0, 0) |
| 600 | err := b.SetAttribs(am, win) |
| 601 | if err != nil { |
| 602 | return nil, err |
| 603 | } |
| 604 | |
| 605 | // Sets optional title |
| 606 | if title := am[AttribTitle]; title != nil { |
| 607 | win.SetTitle(title.(string)) |
| 608 | } |
| 609 | |
| 610 | // Set optional resizable borders |
| 611 | if resiz := am[AttribResizeBorders]; resiz != nil { |
| 612 | win.SetResizable(resiz.(bool)) |
| 613 | } |
| 614 | |
| 615 | // Builds window children |
| 616 | if v := am[AttribItems]; v != nil { |
| 617 | items := v.([]map[string]interface{}) |
| 618 | for i := 0; i < len(items); i++ { |
| 619 | item := items[i] |
| 620 | child, err := b.build(item, win) |
| 621 | if err != nil { |
| 622 | return nil, err |
| 623 | } |
| 624 | win.Add(child) |
| 625 | } |
| 626 | } |
| 627 | return win, nil |
| 628 | } |
| 629 | |
| 630 | // buildChart builds a gui object of type: Chart |
| 631 | func buildChart(b *Builder, am map[string]interface{}) (IPanel, error) { |
nothing calls this directly
no test coverage detected