diff options
| -rw-r--r-- | button.go | 8 | ||||
| -rw-r--r-- | checkbox.go | 8 | ||||
| -rw-r--r-- | combobox.go | 8 | ||||
| -rw-r--r-- | control.go | 1 | ||||
| -rw-r--r-- | label.go | 8 | ||||
| -rw-r--r-- | lineedit.go | 8 | ||||
| -rw-r--r-- | listbox.go | 8 |
7 files changed, 49 insertions, 0 deletions
@@ -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 +} diff --git a/checkbox.go b/checkbox.go index c57059d..4e07a0d 100644 --- a/checkbox.go +++ b/checkbox.go @@ -74,3 +74,11 @@ func (c *Checkbox) setRect(x int, y int, width int, height int) error { return c.sysData.setRect(x, y, width, height) } + +func (c *Checkbox) preferredSize() (width int, height int, err error) { + c.lock.Lock() + defer c.lock.Unlock() + + width, height = c.sysData.preferredSize() + return +} diff --git a/combobox.go b/combobox.go index 2f70fa8..255bcf0 100644 --- a/combobox.go +++ b/combobox.go @@ -110,3 +110,11 @@ func (c *Combobox) setRect(x int, y int, width int, height int) error { return c.sysData.setRect(x, y, width, height) } + +func (c *Combobox) preferredSize() (width int, height int, err error) { + c.lock.Lock() + defer c.lock.Unlock() + + width, height = c.sysData.preferredSize() + return +} @@ -9,4 +9,5 @@ import ( type Control interface { make(window *sysData) error setRect(x int, y int, width int, height int) error + preferredSize() (width int, height int, err error) } @@ -62,3 +62,11 @@ func (l *Label) setRect(x int, y int, width int, height int) error { return l.sysData.setRect(x, y, width, height) } + +func (l *Label) preferredSize() (width int, height int, err error) { + l.lock.Lock() + defer l.lock.Unlock() + + width, height = l.sysData.preferredSize() + return +} diff --git a/lineedit.go b/lineedit.go index ab05085..61f1cf7 100644 --- a/lineedit.go +++ b/lineedit.go @@ -64,3 +64,11 @@ func (l *LineEdit) setRect(x int, y int, width int, height int) error { return l.sysData.setRect(x, y, width, height) } + +func (l *LineEdit) preferredSize() (width int, height int, err error) { + l.lock.Lock() + defer l.lock.Unlock() + + width, height = l.sysData.preferredSize() + return +} @@ -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 +} |
