Even more Windows Table code. Almost done with the prototype test!

This commit is contained in:
Pietro Gagliardi 2015-02-17 21:38:55 -05:00
parent 3099edb9c9
commit c59cbf6de7
1 changed files with 4 additions and 2 deletions

View File

@ -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)
}