From c0473db73c11927144f79bb69d01a290753b5de0 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 30 Jul 2014 12:34:54 -0400 Subject: Ported the new Control setup to Mac OS X. --- redo/table_darwin.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'redo/table_darwin.go') diff --git a/redo/table_darwin.go b/redo/table_darwin.go index 206820a..8417afe 100644 --- a/redo/table_darwin.go +++ b/redo/table_darwin.go @@ -12,24 +12,20 @@ import ( import "C" type table struct { - *widgetbase + *scrolledcontrol *tablebase - - // TODO kludge - table C.id } func finishNewTable(b *tablebase, ty reflect.Type) Table { id := C.newTable() t := &table{ - widgetbase: newWidget(C.newScrollView(id)), - tablebase: b, - table: id, + scrolledcontrol: newScrolledControl(id), + tablebase: b, } - C.tableMakeDataSource(t.table, unsafe.Pointer(t)) + C.tableMakeDataSource(t.id, unsafe.Pointer(t)) for i := 0; i < ty.NumField(); i++ { cname := C.CString(ty.Field(i).Name) - C.tableAppendColumn(t.table, cname) + C.tableAppendColumn(t.id, cname) C.free(unsafe.Pointer(cname)) // free now (not deferred) to conserve memory } return t @@ -41,7 +37,7 @@ func (t *table) Unlock() { // not sure about this one... t.RLock() defer t.RUnlock() - C.tableUpdate(t.table) + C.tableUpdate(t.id) } //export goTableDataSource_getValue -- cgit v1.2.3