From 2218b9e0029f662aaccf7c16dcab3ba1e91bf4cb Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 22 Jul 2025 16:19:57 -0400 Subject: add doc comment for NewRoundSimpleButton --- go/ui/button.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/ui/button.go b/go/ui/button.go index b6cec672..9afa8c05 100644 --- a/go/ui/button.go +++ b/go/ui/button.go @@ -35,6 +35,9 @@ func NewSimpleButton(x, y, w, h int, label string, onClick func(b *SimpleButton) return sb } +// NewRoundSimpleButton creates a circular SimpleButton. +// The shape used for click detection is still a square. +// x and y define the left upper corner of the square (x, y) rect (x+r, y+r). func NewRoundSimpleButton(x, y, r int, label string, onClick func(b *SimpleButton)) *SimpleButton { sb := &SimpleButton{NewWidgetBase(x, y, r, r), label, Gray, color.White, font.Font24, 1.5} sb.EventHandlersMap["click"] = func(int, int) { onClick(sb) } -- cgit v1.2.3