Fixed crashing glitch in Table on Windows.
This commit is contained in:
parent
6d56f6f6b7
commit
c60e775536
|
@ -60,14 +60,11 @@ func tableGetCell(data unsafe.Pointer, item *C.LVITEMW) {
|
||||||
defer t.RUnlock()
|
defer t.RUnlock()
|
||||||
d := reflect.Indirect(reflect.ValueOf(t.data))
|
d := reflect.Indirect(reflect.ValueOf(t.data))
|
||||||
datum := d.Index(int(item.iItem)).Field(int(item.iSubItem))
|
datum := d.Index(int(item.iItem)).Field(int(item.iSubItem))
|
||||||
|
// TODO figure out why changing item.mask causes crashes or why "it just works"
|
||||||
switch d := datum.Interface().(type) {
|
switch d := datum.Interface().(type) {
|
||||||
case ImageIndex:
|
case ImageIndex:
|
||||||
item.mask |= C.LVIF_IMAGE
|
|
||||||
item.mask &^= C.LVIF_TEXT
|
|
||||||
item.iImage = C.int(d)
|
item.iImage = C.int(d)
|
||||||
default:
|
default:
|
||||||
item.mask |= C.LVIF_TEXT
|
|
||||||
item.mask &^= C.LVIF_IMAGE
|
|
||||||
s := fmt.Sprintf("%v", datum)
|
s := fmt.Sprintf("%v", datum)
|
||||||
item.pszText = toUTF16(s)
|
item.pszText = toUTF16(s)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue