Add a MenuElement to the ContainerRow.
(name string, element MenuElement)
| 2965 | |
| 2966 | // Add a MenuElement to the ContainerRow. |
| 2967 | func (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 | |
| 2980 | func (row *ContainerRow) Destroy() { |
| 2981 | for _, element := range row.Elements { |
no outgoing calls
no test coverage detected