From 53db57745f2b0bdb0d6097d6d12d3d7af8f6c639 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 24 Feb 2014 10:56:35 -0500 Subject: Added Control.preferredSize() and preferredSize() for all the standard Controls. --- button.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'button.go') diff --git a/button.go b/button.go index ffbdc6d..e303ef4 100644 --- a/button.go +++ b/button.go @@ -67,3 +67,11 @@ func (b *Button) setRect(x int, y int, width int, height int) error { return b.sysData.setRect(x, y, width, height) } + +func (b *Button) preferredSize() (width int, height int, err error) { + b.lock.Lock() + defer b.lock.Unlock() + + width, height = b.sysData.preferredSize() + return +} -- cgit v1.2.3