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

Method setBranchState

core/tree.go:511–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509}
510
511func (tr *Tree) setBranchState() {
512 br := tr.Branch
513 if br == nil {
514 return
515 }
516 switch {
517 case !tr.This.(Treer).CanOpen():
518 br.SetState(true, states.Indeterminate)
519 case tr.Closed:
520 br.SetState(false, states.Indeterminate)
521 br.SetState(false, states.Checked)
522 br.NeedsRender()
523 default:
524 br.SetState(false, states.Indeterminate)
525 br.SetState(true, states.Checked)
526 br.NeedsRender()
527 }
528}
529
530// Tree is tricky for alloc because it is both a layout
531// of its children but has to maintain its own bbox for its own widget.

Callers 4

InitMethod · 0.95
PositionMethod · 0.95
CloseMethod · 0.95
OpenMethod · 0.95

Calls 3

NeedsRenderMethod · 0.80
CanOpenMethod · 0.65
SetStateMethod · 0.45

Tested by

no test coverage detected