From e252945cb386312d9fb79b2fbe3179e4b1e40a62 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 21 Feb 2015 15:53:13 -0500 Subject: Implemented Table column names on all platforms. Updates #40. --- table_unix.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'table_unix.go') diff --git a/table_unix.go b/table_unix.go index 0857014..97873b0 100644 --- a/table_unix.go +++ b/table_unix.go @@ -61,7 +61,11 @@ func finishNewTable(b *tablebase, ty reflect.Type) Table { C.gpointer(unsafe.Pointer(t))) C.gtk_tree_view_set_model(t.treeview, t.modelgtk) for i := 0; i < ty.NumField(); i++ { - cname := togstr(ty.Field(i).Name) + colname := ty.Field(i).Tag.Get("uicolumn") + if colname == "" { + colname = ty.Field(i).Name + } + cname := togstr(colname) switch { case ty.Field(i).Type == reflect.TypeOf((*image.RGBA)(nil)): // can't use GDK_TYPE_PIXBUF here because it's a macro that expands to a function and cgo hates that -- cgit v1.2.3