BuildLayout builds and returns an VBoxLayout with the specified attributes
(b *Builder, am map[string]interface{})
| 62 | |
| 63 | // BuildLayout builds and returns an VBoxLayout with the specified attributes |
| 64 | func (bl *BuilderLayoutVBox) BuildLayout(b *Builder, am map[string]interface{}) (ILayout, error) { |
| 65 | |
| 66 | // Creates layout and sets optional spacing |
| 67 | l := NewVBoxLayout() |
| 68 | var spacing float32 |
| 69 | if sp := am[AttribSpacing]; sp != nil { |
| 70 | spacing = sp.(float32) |
| 71 | } |
| 72 | l.SetSpacing(spacing) |
| 73 | |
| 74 | // Sets optional vertical alignment |
| 75 | if av := am[AttribAlignh]; av != nil { |
| 76 | l.SetAlignV(av.(Align)) |
| 77 | } |
| 78 | |
| 79 | // Sets optional minheight flag |
| 80 | if mh := am[AttribAutoHeight]; mh != nil { |
| 81 | l.SetAutoHeight(mh.(bool)) |
| 82 | } |
| 83 | |
| 84 | // Sets optional minwidth flag |
| 85 | if mw := am[AttribAutoWidth]; mw != nil { |
| 86 | l.SetAutoWidth(mw.(bool)) |
| 87 | } |
| 88 | return l, nil |
| 89 | } |
| 90 | |
| 91 | // BuildParams builds and returns a pointer to VBoxLayoutParams with the specified attributes |
| 92 | func (bl *BuilderLayoutVBox) BuildParams(b *Builder, am map[string]interface{}) (interface{}, error) { |
nothing calls this directly
no test coverage detected