cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.31k stars 71 forks source link

Remove UpdateStart and UpdateEnd since they are unnecessary and excessively complicated #931

Closed kkoreilly closed 3 months ago

kkoreilly commented 3 months ago

These functions are no longer necessary with the new render context mutex that ensures concurrency safety for everything with the AsyncLock and AsyncUnlock functions. All UpdateStart calls can be removed, and UpdateEndRender should become NeedsRender, and UpdateEndLayout should become NeedsLayout. This reduces code boilerplate significantly and makes updating much simpler and easier to understand; Update is now the single, easy, common end-user pathway to fully update a widget.