From c59cbf6de7334615ebbb917a6ec3ae8e6a0639f3 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 17 Feb 2015 21:38:55 -0500 Subject: Even more Windows Table code. Almost done with the prototype test! --- table_windows.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'table_windows.go') diff --git a/table_windows.go b/table_windows.go index 6dec90f..6c357c9 100644 --- a/table_windows.go +++ b/table_windows.go @@ -92,7 +92,9 @@ func tableGetCell(data unsafe.Pointer, item *C.LVITEMW) C.LRESULT { isText := true switch { case datum.Type() == reflect.TypeOf((*image.RGBA)(nil)): - bitmap := unsafe.Pointer(C.toBitmap(xxxxx TODO xxxx)) + i := datum.Interface().(*image.RGBA) + hbitmap := C.toBitmap(unsafe.Pointer(i), C.intptr_t(i.Dx()), C.intptr_t(i.Dy())) + bitmap := unsafe.Pointer(hbitmap) t.freeLock.Lock() t.free[bitmap] = true // bitmap freed with C.freeBitmap() t.freeLock.Unlock() @@ -124,7 +126,7 @@ func tableFreeData(gotable unsafe.Pointer, data unsafe.Pointer) { if b == false { C.free(data) } else { - // TODO + C.freeBitmap(data) } delete(t.free, data) } -- cgit v1.2.3