Cogent Core Docs

0%

Loading...

Static preview:

Async

Most of the time, updating happens synchronously through event handlers, stylers, updaters, and makers. However, sometimes you need to update content asynchronously from another goroutine. When you do so, you just need to protect any updates you make to widgets with core.WidgetBase.AsyncLock and core.WidgetBase.AsyncUnlock.

For example, this code utilizes a goroutine to update text to the current time every second:

22:27:22