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. --- listbox.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'listbox.go') diff --git a/listbox.go b/listbox.go index 9f87ad6..b333f79 100644 --- a/listbox.go +++ b/listbox.go @@ -110,3 +110,11 @@ func (l *Listbox) setRect(x int, y int, width int, height int) error { return l.sysData.setRect(x, y, width, height) } + +func (l *Listbox) preferredSize() (width int, height int, err error) { + l.lock.Lock() + defer l.lock.Unlock() + + width, height = l.sysData.preferredSize() + return +} -- cgit v1.2.3