diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-04 17:03:07 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-04 17:03:07 -0400 |
| commit | 1ba1f475ba1652d57ff569d42ede09944d74f2fb (patch) | |
| tree | 8308b8319c81047d988fdc0da3c96450c2011aa8 /redo/container_darwin.go | |
| parent | 39a2414cf94a6f69ddca853fd9ed97a576e30dd2 (diff) | |
Switched Tab on Mac OS X to use a dedicated container type system. This container type will eventually be the new home of all the sizer stuff. Now to remove the dedicated NSTabView stuff...
Diffstat (limited to 'redo/container_darwin.go')
| -rw-r--r-- | redo/container_darwin.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/redo/container_darwin.go b/redo/container_darwin.go new file mode 100644 index 0000000..fd28b4c --- /dev/null +++ b/redo/container_darwin.go @@ -0,0 +1,31 @@ +// 4 august 2014 + +package ui + +import ( + "unsafe" +) + +// #include "objc_darwin.h" +import "C" + +type container struct { + view C.id + *sizer +} + +func newContainer(child Control) *container { + c := &container{ + sizer: new(sizer), + } + c.view = C.newContainerView(unsafe.Pointer(c)) + c.child = child + c.child.setParent(&controlParent{c.view}) + return c +} + +//export containerResized +func containerResized(data unsafe.Pointer, width C.intptr_t, height C.intptr_t) { + c := (*container)(unsafe.Pointer(data)) + c.resize(0, 0, int(width), int(height)) +} |
