summaryrefslogtreecommitdiff
path: root/redo/tab_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-04 17:07:06 -0400
committerPietro Gagliardi <[email protected]>2014-08-04 17:07:06 -0400
commit84297ad7e13d3f10e967358ad10e286e9e193584 (patch)
tree152572455fa8a60143f072dae65465146d995dd8 /redo/tab_darwin.go
parent1ba1f475ba1652d57ff569d42ede09944d74f2fb (diff)
Cleaned up Mac OS X Tab code from the previous commit.
Diffstat (limited to 'redo/tab_darwin.go')
-rw-r--r--redo/tab_darwin.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/redo/tab_darwin.go b/redo/tab_darwin.go
index 3a9b338..25b94d0 100644
--- a/redo/tab_darwin.go
+++ b/redo/tab_darwin.go
@@ -15,9 +15,9 @@ type tab struct {
}
func newTab() Tab {
- t := new(tab)
- t._id = C.newTab(unsafe.Pointer(t))
- return t
+ return &tab{
+ _id: C.newTab(),
+ }
}
func (t *tab) Append(name string, control Control) {
@@ -28,15 +28,6 @@ func (t *tab) Append(name string, control Control) {
C.tabAppend(t._id, cname, c.view)
}
-//export tabResized
-func tabResized(data unsafe.Pointer, width C.intptr_t, height C.intptr_t) {
-// t := (*tab)(unsafe.Pointer(data))
-// for _, c := range t.tabs {
- // the tab area's coordinate system is localized, so the origin is (0, 0)
-// c.resize(0, 0, int(width), int(height))
-// }
-}
-
func (t *tab) id() C.id {
return t._id
}
@@ -54,7 +45,7 @@ func (t *tab) preferredSize(d *sizing) (width, height int) {
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
+// no need to override Control.commitResize() as only prepared the tabbed control; its children will be resized when that one is resized (and NSTabView itself will call setFrame: for us)
func (t *tab) commitResize(a *allocation, d *sizing) {
basecommitResize(t, a, d)
}