From 5a51263adc6d2e8ee7ea0dac4d92a66755c07cb1 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 30 Jul 2014 00:54:50 -0400 Subject: Renamed the controls* and containers* files to basicctrls* and containerctrls*, respectively, in preparation for the widget hierarchy redo. --- redo/containers_darwin.go | 48 ----------------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 redo/containers_darwin.go (limited to 'redo/containers_darwin.go') diff --git a/redo/containers_darwin.go b/redo/containers_darwin.go deleted file mode 100644 index 0e0221a..0000000 --- a/redo/containers_darwin.go +++ /dev/null @@ -1,48 +0,0 @@ -// 25 july 2014 - -package ui - -import ( - "unsafe" -) - -// #include "objc_darwin.h" -import "C" - -type tab struct { - *widgetbase - - containers []*container -} - -func newTab() Tab { - t := new(tab) - id := C.newTab(unsafe.Pointer(t)) - t.widgetbase = newWidget(id) - return t -} - -func (t *tab) Append(name string, control Control) { - // TODO isolate and standardize - c := new(container) - t.containers = append(t.containers, c) - cname := C.CString(name) - defer C.free(unsafe.Pointer(cname)) - tabview := C.tabAppend(t.id, cname) - c.child = control - c.child.setParent(&controlParent{tabview}) -} - -func (t *tab) allocate(x int, y int, width int, height int, d *sizing) []*allocation { - // only prepared the tabbed control; its children will be reallocated when that one is resized - return t.widgetbase.allocate(x, y, width, height, d) -} - -//export tabResized -func tabResized(data unsafe.Pointer, width C.intptr_t, height C.intptr_t) { - t := (*tab)(unsafe.Pointer(data)) - for _, c := range t.containers { - // the tab area's coordinate system is localized, so the origin is (0, 0) - c.resize(0, 0, int(width), int(height)) - } -} -- cgit v1.2.3