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

Method SelectPos

gui/list.go:211–223  ·  view source on GitHub ↗

SelectPos selects or unselects the item at the specified position

(pos int, state bool)

Source from the content-addressed store, hash-verified

209
210// SelectPos selects or unselects the item at the specified position
211func (li *List) SelectPos(pos int, state bool) {
212
213 if pos < 0 || pos >= len(li.items) {
214 return
215 }
216 litem := li.items[pos].(*ListItem)
217 if litem.selected == state {
218 return
219 }
220 litem.SetSelected(state)
221 li.update()
222 li.Dispatch(OnChange, nil)
223}
224
225// SetItemPadLeftAt sets the additional left padding for this item
226// It is used mainly by the tree control

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
DispatchMethod · 0.65
SetSelectedMethod · 0.45

Tested by

no test coverage detected