MCPcopy Create free account
hub / github.com/cogentcore/core / Unselect

Method Unselect

core/tree.go:690–705  ·  view source on GitHub ↗

Unselect unselects this node (if selected). You must use this method to update global selection list.

()

Source from the content-addressed store, hash-verified

688// Unselect unselects this node (if selected).
689// You must use this method to update global selection list.
690func (tr *Tree) Unselect() {
691 if tr.StateIs(states.Selected) {
692 tr.SetSelected(false)
693 tr.Style()
694 sl := tr.GetSelectedNodes()
695 sz := len(sl)
696 for i := 0; i < sz; i++ {
697 if sl[i] == tr {
698 sl = append(sl[:i], sl[i+1:]...)
699 break
700 }
701 }
702 tr.SetSelectedNodes(sl)
703 tr.NeedsRender()
704 }
705}
706
707// UnselectAll unselects all selected items in the tree.
708func (tr *Tree) UnselectAll() {

Callers 4

DuplicateMethod · 0.95
selectUpdateMethod · 0.95
UnselectEventMethod · 0.95
OpenURLMethod · 0.80

Calls 6

StyleMethod · 0.95
GetSelectedNodesMethod · 0.95
SetSelectedNodesMethod · 0.95
StateIsMethod · 0.80
NeedsRenderMethod · 0.80
SetSelectedMethod · 0.45

Tested by

no test coverage detected