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

Method SetSelected

gui/list.go:197–208  ·  view source on GitHub ↗

SetSelected selects or unselects the specified item

(item IPanel, state bool)

Source from the content-addressed store, hash-verified

195
196// SetSelected selects or unselects the specified item
197func (li *List) SetSelected(item IPanel, state bool) {
198
199 for _, curr := range li.items {
200 litem := curr.(*ListItem)
201 if litem.item == item {
202 litem.SetSelected(state)
203 li.update()
204 li.Dispatch(OnChange, nil)
205 return
206 }
207 }
208}
209
210// SelectPos selects or unselects the item at the specified position
211func (li *List) SelectPos(pos int, state bool) {

Callers 4

SelectPosMethod · 0.45
selNextMethod · 0.45
selPrevMethod · 0.45
setSelectionMethod · 0.45

Calls 2

updateMethod · 0.95
DispatchMethod · 0.65

Tested by

no test coverage detected