loop

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package loop owns the state shared by every window: one lock that serializes rendering and callbacks, a queue of updates from other goroutines, and the windows to redraw. UI infrastructure uses it; theme only requests redraws.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drain

func Drain()

Drain runs queued functions. Call it with Lock held.

func InvalidateAll

func InvalidateAll()

InvalidateAll requests a redraw of every window. It never blocks on them.

func Lock

func Lock()

Lock is held while a window lays out a frame, and so during every UI callback.

func Post

func Post(fn func())

Post queues fn for the next frame and wakes every window.

func Register

func Register(key any, invalidate func())

Register adds a window; invalidate requests a redraw of it.

func SetIdleMemoryReclaim added in v0.1.6

func SetIdleMemoryReclaim(enabled bool)

func Unlock

func Unlock()

func Unregister

func Unregister(key any) int

Unregister removes a window and reports how many remain.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL