Skip to content

cocoa: put a control picture on the real button - #104

Merged
tannevaled merged 1 commit into
mainfrom
button-image
Sep 5, 2026
Merged

cocoa: put a control picture on the real button#104
tannevaled merged 1 commit into
mainfrom
button-image

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A toolbar is icons. This passes a Native picture through to the NSImage behind it (go-macos/appkit v0.4.0, go-widgets/toolkit v0.306.0).

Only when it changed, and compared by content: the application rebuilds its descriptor every frame, so a fresh slice holding the same picture is the same picture. Decoding a PNG sixty times a second to hand AppKit what it already has is work for nothing, and it makes a button flicker as its cell is replaced under the pointer.

Consumer: godl queue window toolbar.

🤖 Generated with Claude Code

A toolbar is icons. This passes a Native picture through to the NSImage
behind it (go-macos/appkit v0.4.0, go-widgets/toolkit v0.306.0).

Only when it changed, and compared by CONTENT: the application rebuilds
its descriptor every frame, so a fresh slice holding the same picture is
the same picture. Decoding a PNG sixty times a second to hand AppKit what
it already has is work for nothing, and it makes a button flicker as its
cell is replaced under the pointer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 7000292 into main Sep 5, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant