MCPcopy Create free account
hub / github.com/SolarLune/masterplan / Add

Method Add

gui.go:2967–2978  ·  view source on GitHub ↗

Add a MenuElement to the ContainerRow.

(name string, element MenuElement)

Source from the content-addressed store, hash-verified

2965
2966// Add a MenuElement to the ContainerRow.
2967func (row *ContainerRow) Add(name string, element MenuElement) {
2968 if name == "" {
2969 name = strconv.Itoa(int(rand.Int63()))
2970 }
2971 if _, exists := row.Elements[name]; exists {
2972 panic("ERROR: Cannot add GUI element by name of '" + name + "' to ContainerRow ")
2973 }
2974 row.Elements[name] = element
2975 row.ElementOrder = append(row.ElementOrder, element)
2976
2977 // return row
2978}
2979
2980func (row *ContainerRow) Destroy() {
2981 for _, element := range row.Elements {

Callers 3

ConstructMenusFunction · 0.95
DrawMethod · 0.45
DrawMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected