MCPcopy
hub / github.com/lxn/walk / SetCheckedCondition

Method SetCheckedCondition

action.go:154–174  ·  view source on GitHub ↗
(c Condition)

Source from the content-addressed store, hash-verified

152}
153
154func (a *Action) SetCheckedCondition(c Condition) {
155 if a.checkedCondition != nil {
156 a.checkedCondition.Changed().Detach(a.checkedConditionChangedHandle)
157 }
158
159 a.checkedCondition = c
160
161 if c != nil {
162 a.checked = c.Satisfied()
163
164 a.checkedConditionChangedHandle = c.Changed().Attach(func() {
165 if a.checked != c.Satisfied() {
166 a.checked = !a.checked
167
168 a.raiseChanged()
169 }
170 })
171 }
172
173 a.raiseChanged()
174}
175
176func (a *Action) Default() bool {
177 return a.defawlt

Callers

nothing calls this directly

Calls 5

raiseChangedMethod · 0.95
ChangedMethod · 0.65
SatisfiedMethod · 0.65
DetachMethod · 0.45
AttachMethod · 0.45

Tested by

no test coverage detected