From d018953d7ef1b276cc3229e04ba6fc75018c888a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 2 Aug 2014 22:35:58 -0400 Subject: Split all the Control implementations into their own files and renamed the containerctrls implementation files to say tab instead as they only hold Tab. This is the first part of what should hopefully be the final restructuring. --- redo/containerctrls_darwin.go | 50 ------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 redo/containerctrls_darwin.go (limited to 'redo/containerctrls_darwin.go') diff --git a/redo/containerctrls_darwin.go b/redo/containerctrls_darwin.go deleted file mode 100644 index ef834ad..0000000 --- a/redo/containerctrls_darwin.go +++ /dev/null @@ -1,50 +0,0 @@ -// 25 july 2014 - -package ui - -import ( - "unsafe" -) - -// #include "objc_darwin.h" -import "C" - -type tab struct { - *controlbase - - tabs []*sizer -} - -func newTab() Tab { - t := new(tab) - id := C.newTab(unsafe.Pointer(t)) - t.controlbase = newControl(id) - t.fpreferredSize = t.tabpreferredSize - return t -} - -func (t *tab) Append(name string, control Control) { - s := new(sizer) - t.tabs = append(t.tabs, s) - cname := C.CString(name) - defer C.free(unsafe.Pointer(cname)) - tabview := C.tabAppend(t.id, cname) - s.child = control - s.child.setParent(&controlParent{tabview}) -} - -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) { - t := (*tab)(unsafe.Pointer(data)) - for _, s := range t.tabs { - // the tab area's coordinate system is localized, so the origin is (0, 0) - s.resize(0, 0, int(width), int(height)) - } -} -- cgit v1.2.3