MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / SetNodeSelectedFunc

Method SetNodeSelectedFunc

internal/ui/components/node_list.go:137–147  ·  view source on GitHub ↗

SetNodeSelectedFunc sets the function to be called when a node is selected.

(handler func(*api.Node))

Source from the content-addressed store, hash-verified

135
136// SetNodeSelectedFunc sets the function to be called when a node is selected.
137func (nl *NodeList) SetNodeSelectedFunc(handler func(*api.Node)) {
138 nl.onSelect = handler
139
140 nl.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
141 if index >= 0 && index < len(nl.nodes) {
142 if nl.onSelect != nil {
143 nl.onSelect(nl.nodes[index])
144 }
145 }
146 })
147}
148
149// SetNodeChangedFunc sets the function to be called when selection changes.
150func (nl *NodeList) SetNodeChangedFunc(handler func(*api.Node)) {

Callers

nothing calls this directly

Calls 1

SetSelectedFuncMethod · 0.80

Tested by

no test coverage detected