MCPcopy Index your code
hub / github.com/g3n/engine / BuildLayout

Method BuildLayout

gui/builder_layout.go:64–89  ·  view source on GitHub ↗

BuildLayout builds and returns an VBoxLayout with the specified attributes

(b *Builder, am map[string]interface{})

Source from the content-addressed store, hash-verified

62
63// BuildLayout builds and returns an VBoxLayout with the specified attributes
64func (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
92func (bl *BuilderLayoutVBox) BuildParams(b *Builder, am map[string]interface{}) (interface{}, error) {

Callers

nothing calls this directly

Calls 5

SetSpacingMethod · 0.95
SetAlignVMethod · 0.95
SetAutoHeightMethod · 0.95
SetAutoWidthMethod · 0.95
NewVBoxLayoutFunction · 0.85

Tested by

no test coverage detected