summaryrefslogtreecommitdiff
path: root/newctrl/tab_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-10-18 17:03:38 -0400
committerPietro Gagliardi <[email protected]>2014-10-18 17:03:38 -0400
commitaed423a09f35e26a318bd44a6670d4222906de9a (patch)
tree01ad31d5c137859dfeae5f42094834b405971177 /newctrl/tab_darwin.go
parent62048303a34f6cac733798651adb53b640e2114a (diff)
Remvoed the newctrl working directory.
Diffstat (limited to 'newctrl/tab_darwin.go')
-rw-r--r--newctrl/tab_darwin.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/newctrl/tab_darwin.go b/newctrl/tab_darwin.go
deleted file mode 100644
index 112b81e..0000000
--- a/newctrl/tab_darwin.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// 25 july 2014
-
-package ui
-
-import (
- "unsafe"
-)
-
-// #include "objc_darwin.h"
-import "C"
-
-type tab struct {
- *controlSingleObject
- tabs []*container
- children []Control
- chainresize func(x int, y int, width int, height int, d *sizing)
-}
-
-func newTab() Tab {
- t := &tab{
- controlSingleObject: newControlSingleObject(C.newTab()),
- }
- t.fpreferredSize = t.xpreferredSize
- t.chainresize = t.fresize
- t.fresize = t.xresize
- return t
-}
-
-func (t *tab) Append(name string, control Control) {
- c := newContainer()
- t.tabs = append(t.tabs, c)
- control.setParent(c.parent())
- t.children = append(t.children, control)
- cname := C.CString(name)
- defer C.free(unsafe.Pointer(cname))
- C.tabAppend(t.id, cname, c.id)
-}
-
-func (t *tab) xpreferredSize(d *sizing) (width, height int) {
- s := C.tabPreferredSize(t.id)
- return int(s.width), int(s.height)
-}
-
-func (t *tab) xresize(x int, y int, width int, height int, d *sizing) {
- // first, chain up to change the GtkFrame and its child container
- t.chainresize(x, y, width, height, d)
-
- // now that the containers have the correct size, we can resize the children
- for i, _ := range t.tabs {
- a := t.tabs[i].allocation(false/*TODO*/)
- t.children[i].resize(int(a.x), int(a.y), int(a.width), int(a.height), d)
- }
-}