MCPcopy
hub / github.com/g3n/engine / Remove

Method Remove

gui/tree.go:112–130  ·  view source on GitHub ↗

Remove removes the specified child from the tree or any of its children nodes.

(child IPanel)

Source from the content-addressed store, hash-verified

110// Remove removes the specified child from the tree or any
111// of its children nodes.
112func (t *Tree) Remove(child IPanel) {
113
114 for idx := 0; idx < t.List.Len(); idx++ {
115 curr := t.List.ItemAt(idx)
116 if curr == child {
117 node, ok := curr.(*TreeNode)
118 if ok {
119 node.remove()
120 } else {
121 t.List.Remove(child)
122 }
123 return
124 }
125 node, ok := curr.(*TreeNode)
126 if ok {
127 node.Remove(child)
128 }
129 }
130}
131
132// Selected returns the currently selected element or nil
133func (t *Tree) Selected() IPanel {

Callers 15

SetIconMethod · 0.45
SetTextMethod · 0.45
SetIconMethod · 0.45
SetIconMethod · 0.45
SetImageMethod · 0.45
RemoveMethod · 0.45
removeMethod · 0.45
removeItemsMethod · 0.45
ClearMethod · 0.45
removeRowMethod · 0.45
SetTitleMethod · 0.45
ClearScaleXMethod · 0.45

Calls 3

removeMethod · 0.80
LenMethod · 0.45
ItemAtMethod · 0.45

Tested by

no test coverage detected