summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 11:35:41 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 11:35:41 -0400
commitdf383ada764d883b5008988e506472548d052ae8 (patch)
treeb2821ec3e77b7879b3925700c65ca25cab85b41c
parentfecf53827ac7e697c1f36b4db11157828e68b1b9 (diff)
Figured out the deal with item.mask on Windows Tables. Need to rewrite this...
-rw-r--r--redo/table_windows.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/redo/table_windows.go b/redo/table_windows.go
index 281f0d4..9fee4c4 100644
--- a/redo/table_windows.go
+++ b/redo/table_windows.go
@@ -81,6 +81,21 @@ func (t *table) OnSelected(f func()) {
t.selected.set(f)
}
+func printMask(item *C.LVITEMW) {
+fmt.Printf("%d %d ", item.iItem, item.iSubItem)
+x := item.mask
+if x&C.LVIF_COLUMNS != 0{ fmt.Print("LVIF_COLUMNS ") }
+if x&C.LVIF_DI_SETITEM != 0{ fmt.Print("LVIF_DI_SETITEM ") }
+if x&C.LVIF_GROUPID != 0{ fmt.Print("LVIF_GROUPID ") }
+if x&C.LVIF_IMAGE != 0{ fmt.Print("LVIF_IMAGE ") }
+if x&C.LVIF_INDENT != 0{ fmt.Print("LVIF_INDENT ") }
+if x&C.LVIF_NORECOMPUTE != 0{ fmt.Print("LVIF_NORECOMPUTE ") }
+if x&C.LVIF_PARAM != 0{ fmt.Print("LVIF_PARAM ") }
+if x&C.LVIF_STATE != 0{ fmt.Print("LVIF_STATE ") }
+if x&C.LVIF_TEXT != 0{ fmt.Print("LVIF_TEXT ") }
+fmt.Print("\n")
+}
+
//export tableGetCell
func tableGetCell(data unsafe.Pointer, item *C.LVITEMW) {
t := (*table)(data)
@@ -88,7 +103,7 @@ func tableGetCell(data unsafe.Pointer, item *C.LVITEMW) {
defer t.RUnlock()
d := reflect.Indirect(reflect.ValueOf(t.data))
datum := d.Index(int(item.iItem)).Field(int(item.iSubItem))
- // TODO figure out why changing item.mask causes crashes or why "it just works"
+printMask(item)
switch {
case datum.Type() == reflect.TypeOf(ImageIndex(0)):
item.iImage = C.int(datum.Interface().(ImageIndex))