diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-02 08:04:44 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-02 08:04:44 -0400 |
| commit | 85fb097ab97603ff2539ec7a3abd6ae8b96a44cb (patch) | |
| tree | 7b586ebffdd7a03ce504c4b687a23ddec2bd13aa /redo/containerctrls_darwin.go | |
| parent | 37cf0a20c06d457755f209d3fc393f9593c534af (diff) | |
Wrote Control.preferredSize() (including Tab.preferredSize()) on Mac OS X.
Diffstat (limited to 'redo/containerctrls_darwin.go')
| -rw-r--r-- | redo/containerctrls_darwin.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/redo/containerctrls_darwin.go b/redo/containerctrls_darwin.go index 4c70cce..ef834ad 100644 --- a/redo/containerctrls_darwin.go +++ b/redo/containerctrls_darwin.go @@ -19,6 +19,7 @@ func newTab() Tab { t := new(tab) id := C.newTab(unsafe.Pointer(t)) t.controlbase = newControl(id) + t.fpreferredSize = t.tabpreferredSize return t } @@ -32,7 +33,12 @@ func (t *tab) Append(name string, control Control) { s.child.setParent(&controlParent{tabview}) } -// no need to override Control.allocate() as only prepared the tabbed control; its children will be reallocated when that one is resized +func (t *tab) tabpreferredSize(d *sizing) (width, height int) { + s := C.tabPrefSize(t.id) + return int(s.width), int(s.height) +} + +// no need to override Control.commitResize() as only prepared the tabbed control; its children will be reallocated when that one is resized //export tabResized func tabResized(data unsafe.Pointer, width C.intptr_t, height C.intptr_t) { |
