MCPcopy Create free account
hub / github.com/NV404/gova / FindButtonByLabel

Method FindButtonByLabel

testing.go:126–139  ·  view source on GitHub ↗

FindButtonByLabel returns the first Button with a matching label.

(label string)

Source from the content-addressed store, hash-verified

124
125// FindButtonByLabel returns the first Button with a matching label.
126func (rt *RenderedTree) FindButtonByLabel(label string) ButtonResult {
127 var result ButtonResult
128 walkNodes(rt.root, func(node *viewNode) bool {
129 if node.kind == viewKindButton && node.button != nil && node.button.label == label {
130 result.Label = node.button.label
131 result.handler = node.button.handler
132 result.tree = rt
133 result.found = true
134 return false
135 }
136 return true
137 })
138 return result
139}
140
141// FindToggle returns the nth Toggle node (depth-first).
142func (rt *RenderedTree) FindToggle(n int) ToggleResult {

Callers 1

Calls 1

walkNodesFunction · 0.85

Tested by 1