BuildLayout builds and returns an HBoxLayout with the specified attributes
(b *Builder, am map[string]interface{})
| 11 | |
| 12 | // BuildLayout builds and returns an HBoxLayout with the specified attributes |
| 13 | func (bl *BuilderLayoutHBox) BuildLayout(b *Builder, am map[string]interface{}) (ILayout, error) { |
| 14 | |
| 15 | // Creates layout and sets optional spacing |
| 16 | l := NewHBoxLayout() |
| 17 | var spacing float32 |
| 18 | if sp := am[AttribSpacing]; sp != nil { |
| 19 | spacing = sp.(float32) |
| 20 | } |
| 21 | l.SetSpacing(spacing) |
| 22 | |
| 23 | // Sets optional horizontal alignment |
| 24 | if ah := am[AttribAlignh]; ah != nil { |
| 25 | l.SetAlignH(ah.(Align)) |
| 26 | } |
| 27 | |
| 28 | // Sets optional minheight flag |
| 29 | if mh := am[AttribAutoHeight]; mh != nil { |
| 30 | l.SetAutoHeight(mh.(bool)) |
| 31 | } |
| 32 | |
| 33 | // Sets optional minwidth flag |
| 34 | if mw := am[AttribAutoWidth]; mw != nil { |
| 35 | l.SetAutoWidth(mw.(bool)) |
| 36 | } |
| 37 | return l, nil |
| 38 | } |
| 39 | |
| 40 | // BuildParams builds and returns a pointer to HBoxLayoutParams with the specified attributes |
| 41 | func (bl *BuilderLayoutHBox) BuildParams(b *Builder, am map[string]interface{}) (interface{}, error) { |
nothing calls this directly
no test coverage detected