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

Method Update

core/update.go:56–66  ·  view source on GitHub ↗

Update updates the widget and all of its children by running [WidgetBase.UpdateWidget] and [WidgetBase.Style] on each one, and triggering a new layout pass with [WidgetBase.NeedsLayout]. It is the main way that end users should trigger widget updates, and it is guaranteed to fully update a widget to

()

Source from the content-addressed store, hash-verified

54// call [WidgetBase.AsyncLock] and [WidgetBase.AsyncUnlock] before and
55// after this, respectively.
56func (wb *WidgetBase) Update() { //types:add
57 if DebugSettings.UpdateTrace {
58 fmt.Println("\tDebugSettings.UpdateTrace Update:", wb)
59 }
60 wb.WidgetWalkDown(func(cw Widget, cwb *WidgetBase) bool {
61 cwb.UpdateWidget()
62 cw.Style()
63 return tree.Continue
64 })
65 wb.NeedsLayout()
66}
67
68// UpdateRender is the same as [WidgetBase.Update], except that it calls
69// [WidgetBase.NeedsRender] instead of [WidgetBase.NeedsLayout].

Callers 1

UpdateChangeMethod · 0.95

Calls 5

WidgetWalkDownMethod · 0.95
NeedsLayoutMethod · 0.95
PrintlnMethod · 0.80
UpdateWidgetMethod · 0.80
StyleMethod · 0.65

Tested by

no test coverage detected