diff options
| author | Pietro Gagliardi <[email protected]> | 2015-02-21 15:53:13 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-02-21 15:53:31 -0500 |
| commit | e252945cb386312d9fb79b2fbe3179e4b1e40a62 (patch) | |
| tree | 68bb701867e568176f2ab44914662657e5b3159f /table_windows.go | |
| parent | 23e6739dfabd61fd732d9b78e13a55aeaa7c2c2d (diff) | |
Implemented Table column names on all platforms. Updates #40.
Diffstat (limited to 'table_windows.go')
| -rw-r--r-- | table_windows.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/table_windows.go b/table_windows.go index a26c2f0..159f1c2 100644 --- a/table_windows.go +++ b/table_windows.go @@ -6,6 +6,7 @@ package ui // - why are we not getting keyboard input (focus?) on a mouse click? // - are we getting keyboard input (focus?) on tab? // - random freezes on Windows 7 when resizing headers or clicking new rows; likely another package ui infrastructure issue though... +// - investigate japanese display in the table headers on wine (it has worked in the past in ANSI mode via Shift-JIS with what I assume is the same font, so huh?) import ( "fmt" @@ -53,9 +54,13 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table { case ty.Field(i).Type.Kind() == reflect.Bool: coltype = C.tableColumnCheckbox } - colname := toUTF16(ty.Field(i).Name) - C.SendMessageW(t.hwnd, C.tableAddColumn, coltype, C.LPARAM(uintptr(unsafe.Pointer(colname)))) - // TODO free colname + colname := ty.Field(i).Tag.Get("uicolumn") + if colname == "" { + colname = ty.Field(i).Name + } + ccolname := toUTF16(colname) + C.SendMessageW(t.hwnd, C.tableAddColumn, coltype, C.LPARAM(uintptr(unsafe.Pointer(ccolname)))) + // TODO free ccolname } t.colcount = C.int(ty.NumField()) return t |
