aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/ui/button.go3
1 files changed, 3 insertions, 0 deletions
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) }